How to Check, Repair and Optimize a Database in cPanel

Written by Trifo 0 Comments
How to Check, Repair and Optimize a Database in cPanel

Databases can grow huge in size, especially for blogs, forums and web sites that receive a lot of traffic.

Occasionally, due to software or hardware errors, or bugs in the MySQL database tables, you can come across various issues, such as errors connecting to the database or bad web site performance.

Periodically Checking, Repairing and Optimizing the database will help in preventing such issues, as well as improving the web site performance in general.

Databases can be easily Checked and Repaired from within the cPanel:

Login to cPanel, then navigate to the MySQL Databases section:

Click on Check The Database and Repair The Database for your database:

Optimizing the database is a bit tricky.

Luckily within cPanel, you will find a tool called phpMyAdmin that will help with the task.

Login to cPanel and navigating to the phpMyAdmin tool:

The phpMyAdmin window is separated into two parts.

You have a list of your database on the left, and the main window on the right:

Click on the + next to your cPanel username in order to expand your database list, then click on the database name you are going to Optimize, tick Check All and select Optimize table from the With selected: field:

Depending on the database size, the operation could take longer, but when it is completed, you should see a "Your SQL query has been executed successfully" message:

If you are a Cloud or Dedicated Server power user with root access, you can Check, Repair and Optimize all database in SSH using the following commands:

mysqlcheck --all-databases -c # Check table
mysqlcheck --all-databases -r # Repair table
mysqlcheck --all-databases -o # Optimize table

Keeping your database immaculate and tidy is one of the musts, when optimising your web site for better performance.

Watch me check, repair and optimize a database in cPanel in 1 minute:


Please feel free to contact us if you have any further questions or comments.

You might also like...

About the Author

Trifo works in customer support at Kualo. He's a ninja at working with popular open source applications like WordPress, Joomla and Drupal to name a few. Fun fact, Trifo recently became a father!