开发者

phpMyAdmin - can I export an "alter table" query?

开发者 https://www.devze.com 2023-02-14 03:34 出处:网络
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 possi

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

精彩评论

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