This function changes a MySQL® database's name. MySQL does not allow you to rename a database. When cPanel & WHM "renames" a database, the system performs the following steps:
Warning:
Important:
When you disable the MySQL/MariaDB role and remote MySQL is not already configured, the system disables this function.
HTTP Request was successful.
object |
whmapi1 --output=jsonpretty \ rename_mysql_database \ oldname='database' \ newname='database2'
{- "metadata": {
- "command": "rename_mysql_database",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}