mysql 数据库名怎么改呢?RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
RENAME DATABASE 要改的数据库名 TO 改后的数据库名;
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如上,出错。我查了下,有些版本不支持这命令。 官方网http://dev.mysql.com/doc/refman/5.1/en/rename-database.html 里面也不建议重命令数据库。 那这问题就这样吧谢谢楼上2位
RENAME DATABASE 要改的数据库名 TO 改后的数据库名;
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如上,出错。我查了下,有些版本不支持这命令。
官方网http://dev.mysql.com/doc/refman/5.1/en/rename-database.html 里面也不建议重命令数据库。
那这问题就这样吧谢谢楼上2位