June 2015
Beginner
140 pages
3h
English
After a hardware failure, a power outage, or even after an upgrade, it is a good idea to check the tables in our MariaDB databases to make sure they are all right. MariaDB includes several utilities for doing this.
The mysqlcheck program can check, analyze, optimize, and repair the MariaDB database tables. Basic syntax for the command is as follows:
mysqlcheck [options] [-u username] [-p] database_name [table_name]
Here is an example of running the command to check our test database, and its output:
daniel@gandalf:~$ mysqlcheck -u root -p test Enter password: test.employees OK
We can specify multiple databases using the --databases option as follows:
mysqlcheck -u root -p --databases ...Read now
Unlock full access