问题:
The MySQL manual at MySQL covers this. 在MySQL手册的MySQL涵盖这一点。
Usually I just dump the database and reimport it with a new name. 通常我只是转储数据库并使用新名称重新导入它。 This is not an option for very big databases. 对于非常大的数据库,这不是一个选项。 Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
显然是RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
does bad things, exist only in a handful of versions, and is a bad idea overall . 做坏事,只存在于少数几个版本中,总体上是一个坏主意 。
This needs to work with InnoDB , which stores things very differently than MyISAM . 这需要与InnoDB一起使用, InnoDB的存储方式与MyISAM完全不同。
解决方案:
参考一: https://stackoom.com/question/HS9/如何快速重命名MySQL数据库-更改模式名称参考二: https://oldbug.net/q/HS9/How-do-I-quickly-rename-a-MySQL-database-change-schema-name
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4319001