RENAME DATABASE
Changes the name of a 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 |
+--------------------+