Accidental deletion of a MySQL database

更新时间:
复制 MD 格式

After you log in to a MySQL database on a cloud web host using DMS, you may not see any database information. This topic describes the possible causes of this issue and provides solutions.

Symptoms

When you log in to a MySQL database on a cloud web host using DMS, you cannot see any database information.

The database drop-down list displays only the information_schema system database. User-created databases do not appear.

Possible cause

The MySQL database of the cloud web host was accidentally deleted from a database client on a local host.

Solution

  1. Restore the MySQL database.

    You can restore the database by using one of the following methods:

    • (Recommended) Restore the database using DMS.

      1. Log on to the cloud web host database.

        For more information, see Log on to a database by using the web-based version of DMS.

      2. In the top menu bar, click SQL Window.

      3. On the SQL Window page, enter the following statement.

        create database your_cloud_web_host_database_name;

        Replace your_cloud_web_host_database_name in the statement with your database name.

      4. Exit DMS.

    • Restore the database using Navicat for MySQL.

      1. On your local host, start Navicat for MySQL.

      2. In the menu bar, choose Connection > MySQL.

      3. In the MySQL - New Connection dialog box, enter the database information for your cloud web host and click Connect.

      4. In the left navigation pane, right-click the new connection and select Open Connection.

      5. In the left navigation pane, right-click the connection name and select New Database.

      6. In the New Database dialog box, specify the database details and click OK.

        Configure the following settings:

        • Database Name: Enter your database name.

        • Character set: Set this to utf-8.

        After you create the database, a node for the new database appears in the left navigation pane.

  2. Reconnect to the database using DMS and verify that it has been restored.

    If the issue persists, submit a ticket.