我想更改数据库中的所有表类型但不使用SUPER USER。我想使用ALTER TABLE脚本尝试更改所有表。你知道如何在列表SELECT QUERY结果上执行任何查询吗?
我创建的示例查询:
// Make an Ajax request, here I am using jQuery $.getJSON but you can use $.get or $.post if you need to have it as a post request, or even $.ajax
$.getJSON('https://example.com/database_fetch_page.php', function(data) {
new Chartist.Line('#headline-chart', data, options);
});
,该查询的结果是:
SELECT CONCAT("ALTER TABLE ", TABLE_SCHEMA,".",TABLE_NAME," ENGINE = InnoDB;") AS Querys
FROM information_schema.TABLES WHERE TABLE_SCHEMA = "database_name" AND ENGINE = "MyISAM"
如何执行表格上的所有查询逐行/行?