mysqlcheck

Check and repair MySQL tables. More information: <https://dev.mysql.com/doc/refman/8.0/en/mysqlcheck.html>.

Install

All systems
curl cmd.cat/mysqlcheck.sh
Debian Debian
apt-get install mariadb-client-core-10.3
Ubuntu
apt-get install percona-xtradb-cluster-client-5.5
Arch Arch Linux
pacman -S percona-server-clients
image/svg+xml Kali Linux
apt-get install mariadb-client-core-10.1
Fedora
dnf install mariadb-3
Windows (WSL2)
sudo apt-get update sudo apt-get install percona-xtradb-cluster-client-5.5
Raspbian
apt-get install mariadb-client-core-5.5

Check and repair MySQL tables. More information: <https://dev.mysql.com/doc/refman/8.0/en/mysqlcheck.html>.

  • Check a table:
    mysqlcheck --check table
  • Check a table and provide credentials to access it:
    mysqlcheck --check table --user username --password password
  • Repair a table:
    mysqlcheck --repair table
  • Optimize a table:
    mysqlcheck --optimize table

© tl;dr; authors and contributors