SSH

How-to optimize MySQL database via SSH

Problem

Mysqltuner shows a warning “Run OPTIMIZE TABLE to defragment tables for better performance”

You want to optimise your MySQL database through SSH.

Cause

MySQL databases can become fragmented over time as database entries are created and deleted. Fragmentation causes MySQL queries to take longer to complete, slowing down your website.

Resolution

Optimize your MySQL database using the command below:

mysqlcheck -op -u username database_name

Replace username and database_name with your database details.

Filed under
SSH

Was this guide helpful?

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London