Reset or clear a database

Updated at:

If your database runs low on space, performance can degrade and prevent you from writing new data. To free up space, you can reset the database of your Web Hosting instance to restore its initial settings. You can also clear all data from tables while preserving their structure, a process useful for tasks like data migration and updates.

Reset a database

Notes

Be aware of the following when resetting a database:

  • The reset process deletes all tables in the database, including their structures and content.

  • The existing login password for the database is deleted. You must set a new one.

  • A database cannot be restored after it is reset. This action is irreversible, so proceed with caution.

    Back up the database before proceeding. For more information, see Back up and restore data.

Procedure

The procedure to reset a database is the same for both Linux and Windows Web Hosting instances. The following steps use a Basic edition Elastic Web Hosting instance on Windows as an example.

  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, find the database that you want to manage and click Reset database in the Actions column.

  5. On the Reset database page, set a new password for the database.

  6. Click Confirm.

    After the database is reset, check the Data usage column on the Database information page. The space usage returns to its initial value. For a SQL Server database, this value is 2.25 MB or 2.26 MB.

    Note

    The initial storage usage after a reset varies by database type:

    • A MySQL database on a Web Hosting instance has an initial usage of 0 MB.

    • A SQL Server database on a Web Hosting instance has an initial usage of 2.25 MB or 2.26 MB.

Clear data from tables

During operations like data migration or system updates, you may need to clear tables while preserving their structure. For instance, when migrating from a test to a production environment, this prevents old test data from causing issues. After clearing the tables, you can import the new data.

  1. Log in to the database of your Web Hosting instance.

  2. In the left-side navigation pane, click the Tables tab. Then, right-click any table and select Batch operations on tables.

  3. On the Batch operations on tables tab, clear the data from one or more tables.

    • Clear data from a single table

      Find the table to clear, click Clear data in the Actions column, and then click Confirm.

    • Clear data from multiple tables

      Select the tables to clear, click Clear data, and then click Confirm.

    After the task is complete, the data in the tables is cleared, and the table structures are preserved.