This function renames a MySQL® database.
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.
uapi --output=jsonpretty \ --user=username \ Mysql \ rename_database \ oldname='mydb' \ newname='newlyrenamed'
{- "apiversion": 3,
- "func": "rename_database",
- "module": "Mysql",
- "result": {
- "data": null,
- "errors": null,
- "messages": null,
- "metadata": { },
- "status": 1,
- "warnings": null
}
}