1. 领加网络的博客首页
  2. 代码库

MySQL批量修改数据表前缀

1.批量将laoyoule数据中的 yy_前缀改成ly_前缀

2.生成Mysql脚本

SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO ly_', substring(table_name, 4),';') FROM information_schema.tables where table_schema='laoyoule' and table_name LIKE 'yy_%';

原创文章,作者:代码加工厂,如若转载,请注明出处:http://blog.lingj.net/2022/05/09/254.html

发表评论

邮箱地址不会被公开。 必填项已用*标注