2017-06-07 53 views
2

我在mysql中有10个表都以大写开头,我想知道是否可以用一个查询而不是20个将它们全部改为小写?Mysql将所有表名改为小写

+0

https://stackoverflow.com/questions/2659684/why-my-tables-names-are-converted-into-lowercase-in-phpmyadmin –

回答

2

检查Amy Anuszewski答案

select concat('rename table ', table_name, ' to ' , lower(table_name) , ';')from information_schema.tables where table_schema = 'your_schema_name'; 
+0

什么是TABLE_SCHEMA? – sasasasa

+0

table_schema是数据库名称。要显示没有任何表的数据库:SELECT s。 schema_name,t。 table_name FROM INFORMATION_SCHEMA ---检查此链接https://dev.mysql.com/doc/refman/5.7/en/tables-table.html – Ghostman

+0

此查询将我重定向到information_schema表,但没有更改表名 – sasasasa

相关问题