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.

The post Check and Repair All MySQL Databases on Ubuntu appeared first on FAQforge.

Ubuntu Server Admin

Recent Posts

How to avoid package End of Life through backporting

In July 2025, git received CVE-2025-48384, a high vulnerability allowing arbitrary code execution when cloning…

3 days ago

Showcasing open design in action: Loughborough University design students explore open source projects

Last year, we collaborated with two design student teams from Loughborough University in the UK.…

7 days ago

Canonical Ubuntu and Ubuntu Pro now available on AWS European Sovereign Cloud

January 15, 2026 – Canonical, the publisher of Ubuntu and provider of open source security,…

1 week ago

How to install GitLab on Ubuntu 24.04

How to install GitLab on Ubuntu 24.04 will be explained in this blog post with…

1 week ago

How to Set Up OpenVPN Access Server on Ubuntu 24.04 (VM) & Connect Using OpenVPN Connect

Do you know what was always there but has increased multiple times in the last…

2 weeks ago

How to build DORA-ready infrastructure with verifiable provenance and reliable support

The Digital Operational Resilience Act (DORA) came into force across the EU on January 17,…

2 weeks ago