只有数据表,没有视图
1、CREATE DATABASE new_db_name; 创建新的数据库
2、RENAME TABLE db_name.table1 TO new_db_name.table1; 对所有的表进行重命名
3、DROP DATABASE db_name; 删除原来的数据库
PHP中文网2017-04-17 16:37:57
Um, can you do this? It is better to rename the database name directly.
If you want to import tables one by one from between two libraries, the standard approach is:
CREATE TABLE new_db_name.table1 LIKE db_name.table1;
INSERT INTO new_db_name.table1 SELECT * FROM db_name.table1;