重命名数据库
更改数据库的名称。
语法
ALTER DATABASE [ IF EXISTS ] <name> RENAME TO <new_db_name>
示例
CREATE DATABASE DATABEND;
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| DATABEND |
| information_schema |
| default |
| system |
+--------------------+
ALTER DATABASE `DATABEND` RENAME TO `NEW_DATABEND`;
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| NEW_DATABEND |
| default |
| system |
+--------------------+