使用phpMyAdmin重命名并在所有表中添加前缀 [英] Rename and add prefix to all tables with phpMyAdmin
本文介绍了使用phpMyAdmin重命名并在所有表中添加前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想添加一个前缀并使用PhpMyAdmin重命名数据库中的所有表.
I want to add a prefix and rename all tables in a database with PhpMyAdmin.
我尝试了这两个脚本:
1)
select concat('rename table', table_name, ' to ', 'prefix_',table_name,';') from information_schema.tables where table_schema='db_name';
2)
SELECT Concat('ALTER TABLE ', TABLE_NAME, ' RENAME TO osc_', TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES where table_schema='db_name';
phpMyAdmin表示脚本正常(请参见屏幕截图),但没有任何变化. phpMyAdmin我缺少什么?
phpMyAdmin says the script is ok (see screen shot) but nothing change. What i am missing with phpMyAdmin ?
推荐答案
最后,我找到了一种简单的方法:
Finally, i found an easy way to do that :
1)选择要添加前缀的所有表
1) select all tables you want to add a prefix
2)在选择选项中选择:替换前缀表
2) choose in the select option : replace prefix table
3)用前缀填充该字段.
3) fill the field with the prefix.
屏幕截图:
这篇关于使用phpMyAdmin重命名并在所有表中添加前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文