56,679
社区成员
发帖
与我相关
我的任务
分享
mysql> create database test1;
Query OK, 1 row affected (0.09 sec)
mysql> rename database test1 to test2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'datab
ase test1 to test2' at line 1
mysql> rename schema test1 to test2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'schem
a test1 to test2' at line 1
RENAME DATABASE 要改的数据库名 TO 改后的数据库名;
RENAME {DATABASE | SCHEMA} db_name TO new_db_name;