Loading...

Knowledge Base

How to Repair and Optimize a Database in Account Manager

A malfunctioning website database can result in downtime and data loss, often due to corrupted files, misconfigurations, or server issues. You can identify, repair, and optimize a database for these errors using tools in Account Manager to swiftly restore functionality.

If you encounter the following error, you can quickly resolve it by using the database tool available in your Account Manager.

Bluehost Database Error


Optimizing Your Database Tables

Repairing and optimizing database tables is essential to ensure the database operates efficiently and effectively. There are several reasons why someone should care about repairing and optimizing tables, such as:

  1. Improved performance: Over time, database tables can become fragmented, leading to slower performance. By repairing and optimizing tables, you can prevent MySQL table fragmentation, resulting in faster query times and improved overall performance.
  2. Enhanced stability: If database tables become corrupt or damaged, it can lead to data loss or other stability issues. Repairing tables can prevent data loss and ensure the stability of the database.
  3. Reduced resource consumption: When database tables are not optimized, it can lead to excessive resource consumption, such as CPU and memory usage. Optimizing tables can reduce resource consumption, lower costs, and improve server performance.

Checking Your Database

  1. Log in to the Bluehost Account Manager.
  2. Click Websites in the left menu.

    Bluehost Account Manager - Websites Tab
     

    • If you have only one website, you will be redirected straight to its Overview panel.
    • If you have multiple websites, all of them will be listed. Click on Settings to access the website's Overview panel.

      Bluehost Account Manager - Websites Tab Settings
       

  3. In the Overview page, click Databases to open the Database Management panel.

    Bluehost Websites Overview Tab - Databases
     

  4. Locate the database name associated with your website.
  5. Click the vertical ellipsis icon next to the database name and select Check Database.

    Bluehost Websites Overview Tab - Check Database
     

  6. A pop-up will show the Table Name and Status.

    Bluehost Websites Overview Tab - Check Database Display
     

    • If the status is OK, your database is functioning properly.
    • If issues are detected, proceed to the next step.

Repairing Your Databases

The diagnostic process will pinpoint the issue. If the result shows "Issues were detected. Repair recommended," proceed with the steps below to address it.

am-check-database-error-issue
 

  1. Choose the database name you're experiencing issues with by verifying the associated Site.
  2. Click the vertical ellipsis icon, and then choose Repair Database.

    Bluehost Websites Overview Tab - Repair Database
     

  3. A pop-up will display the Table Name and Repair Status.
    • If the repair is successful, your site should be operational.
    • If a red exclamation point icon is still displayed, consider the following options below:
      • Use phpMyAdmin to manually optimize and repair database tables.
      • Restore your site using backups from CodeGuard or Jetpack, if available.

Alternative Way of Repairing and Optimizing Your Database

  1. Log in to the Bluehost Account Manager.
  2. Click Websites in the left menu.
    • If you have only one website, you will be redirected straight to its Overview panel.
    • If you have multiple websites, all of them will be listed. Click on Settings to access the website's Overview panel.
  3. In the Overview page, click phpMyAdmin.
  4. To repair or optimize a database, look for the list of databases on the left-hand side. Then, select the database that you want to repair or optimize.
  5. You can see all the tables in your database on the right side. Scroll down to the bottom and select Check All.

    Bluehost cPanel Databases phpMyAdmin Check All
     

  6. Select the Repair Table option from the With Selected drop-down list.

    Bluehost cPanel Databases phpMyAdmin Repair Table
     

  7. This will list all the tables, with "OK" listed next to them.
  8. Click on the Structure tab.
  9. To optimize the table, click Check All again and select the Optimize table option from the drop-down menu.

    Bluehost cPanel Databases phpMyAdmin Optimiz Table
     

  10. Your SQL query has been executed successfully.
This process can fix many MySQL errors. It is recommended that these steps be performed frequently to keep any database in good condition.

In addition to manually repairing and optimizing database tables, alternative solutions are also available. For example, command-line tools like MySQLcheck or Pg_filedump can automate the repair and optimization of tables. Additionally, automated scripts can be set up to regularly check and optimize tables, reducing the need for manual intervention. It's important to consider the specific needs of the database and choose the solution that best fits the situation.

Still Not Fixed?

If you are using InnoDB as a storage engine, we have noticed an issue regarding database size. For various reasons, it occasionally occurs that memory allocated to a customer for database usage is not released when the database no longer requires it. This memory does not appear as in use when the database size is viewed using phpMyAdmin. However, since it is still allocated to the customer account, the server-side administrative tools will include it in calculations of overall database memory usage and determine whether an account has exceeded the database memory limits specified in the Terms of Service.

The easiest way to free this "hidden" memory is to export the database information, completely clear the database, and re-import the information. This will cause phpMyAdmin and the server-side tools to report the actual database usage and prevent account deactivation due to the "hidden" memory usage.

The repair/optimize function in phpMyAdmin will not correct this issue. The server-side tools report complete memory usage and the information required to determine the server's overall performance. That is why the server-side tools are used to determine usage for ToS compliance purposes. The phpMyAdmin does not correctly report all memory usage allocated to the account and is, therefore, not used for these calculations.

Summary

A database error occurs when your website cannot correctly connect to or interact with its database, often resulting in messages like "Error establishing a database connection" or "Database marked as crashed." These errors can disrupt your site's functionality. In this article, we provide a set of instructions on using database tools in your Account Manager to check and repair the database. It also includes troubleshooting tips for persistent issues and links to resources for optimizing databases or restoring backups.

If you need further assistance, feel free to contact us via Chat or Phone:

  • Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
  • Phone Support -
    • US: 888-401-4678
    • International: +1 801-765-9400

You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.

Did you find this article helpful?

 
* Your feedback is too short

Loading...