Change database

更新时间:
复制 MD 格式

As your website traffic and data volume grow rapidly, your current Cloud Web Hosting database may no longer meet your business requirements for TPS and storage capacity. To ensure uninterrupted site access, change your database. This topic describes how to change the database for Cloud Web Hosting instances running different operating systems.

Important notes

  • Back up your site data before changing the database type of your Cloud Web Hosting instance.

    Warning

    Changing the database clears all data in the current database and all historical backups in the backup and restore feature, which causes data loss. If you still need your historical data, make sure it is fully backed up before changing the database. For instructions on backing up historical data, see Back up and restore data.

  • After changing the database, update the database connection string in your website program with the new database information.

    Warning

    If you do not update the database connection string in your website program after changing the database, your site becomes inaccessible. If you lack coding experience or do not have access to your website program’s source code, proceed with caution or consult your website developer.

Procedure

The steps to change the database are the same for Cloud Web Hosting instances running Linux or Windows. This example uses an exclusive Web Hosting instance running Linux with the Premium Edition.

  1. Log on to the Cloud Web Hosting management page.
  2. Find the Cloud Web Hosting instance you want to manage and click Manage in the Actions column.
  3. In the navigation pane on the left, click Database Information.
  4. On the Database Information page, click Change Database in the Actions column.

  5. In the Change Database Version dialog box, select the new database version and click Confirm.

    For example, select MySQL 5.1.73 as the new database version for a Linux-based Cloud Web Hosting instance.

  6. In the Change Database Version dialog box, click Confirm.

    Important

    Read the instructions on the Change Database Version page carefully. Make sure everything is correct before proceeding.

    The Change Database Version page states: This operation clears all data in the current database and all historical backups in the backup and restore feature. Back up your data locally before proceeding. Also, update the database connection string in your website program with the new database details, including the database endpoint, database account, password, and database name. Click Confirm after verifying everything is correct.

    Wait 1 to 3 minutes. The database change succeeds when the database version changes from mysql 5.7.25-log to mysql 5.1.73.

References

  • If your current database runs out of space or is full, you can reset (empty) it based on your business needs. This restores all database settings to their initial state. For instructions, see Reset or empty a database.

  • If you encounter issues such as reaching the maximum number of database connections or needing more database space while using Cloud Web Hosting databases, see Database FAQ.