X

Check and Repair All MySQL Databases on Ubuntu

The following command can be used to check and repair all MySQL databases on a Ubuntu or Debian Linux System. I've tested the commands on Ubuntu 20.04 and Debian 10.

Repair MySQL databases on Ubuntu Linux

sudo mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases

MySQL database repair on Debian

mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases

The benefit of the above command is that it uses the debian-sys-maint login to MySQL which is available on every Debian and Ubuntu System, so you don't have to provide the MySQL root login details.

Till Brehm:
X

Headline

You can control the ways in which we improve and personalize your experience. Please choose whether you wish to allow the following:

Privacy Settings