开发者

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 select开发者_运维百科ed fields. Is this possible?


You can play with 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. You can copy this sql and run it in other dbs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜