RENAME DATABASE
变更数据库的名称。
Syntax
ALTER DATABASE [ IF EXISTS ] <name> RENAME TO <new_db_name>
Examples
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 |
+--------------------+