简体   繁体   English

phpMyAdmin - 我可以导出“alter table”查询吗?

[英]phpMyAdmin - can I export an “alter table” query?

I add a few fields in a table and want to quickly modify the same table in different database - so I want phpMyAdmin to generate the alter table query for selected fields. 我在表中添加了一些字段,并希望在不同的数据库中快速修改同一个表 - 所以我希望phpMyAdmin为所选字段生成alter table查询。 Is this possible? 这可能吗?

You can play with information_schema. 您可以使用information_schema。

select concat('alter table ',table_schema,'.',table_name, '.....;')
from information_schema.tables
where table_name = 'your_table_name'

Then you can run all the queries. 然后,您可以运行所有查询。

I don't think this is possible with phpmyadmin, But you can use a tool like heidisql (windows desktop application) where it displays all the sql it runs when you do changes using the gui. 我不认为这是可能的phpmyadmin,但你可以使用像heidisql (Windows桌面应用程序)这样的工具,它显示当你使用gui进行更改时运行的所有sql。 You can copy this sql and run it in other dbs. 您可以复制此sql并在其他dbs中运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM