MySQL / MariaDB: “Table ./mysql/proc is marked as crashed and should be repaired


Image Source, wikipedia.org: [1], [2]

Eventually you know this: Your server crashed. The server had a running MySQL or MariaDB instance with software which are using the instance to store their data. After a fresh new start after your server crashed, the software you’re normally running constantly claims the following: “Table ./mysql/proc is marked as crashed and should be repaired.”.

How To fix

A fix for that problem is very easy. First, ensure that your server and your MySQL Daemon is normally running again. You can check the MySQL Daemon like this:

root@server:~# service mysql status

If you are running MariaDB, you have to use the following command:

root@server:~# service mariadb status

If the Daemon is not running, you can start them with this command:

root@server:~# service mysql start

Or, if you use MariaDB:

root@server:~# service mariadb start

When you’re sure that MySQL / MariaDB is running, you can issue the following command to get rid of the problem:

root@server:~# mysqlcheck --auto-repair -A -u root -p

Of course, for this command you need your MySQL / MariaDB root password. The now started process can take a long time. It checks every single table in your database on corruption. If there is a corruption found, it will be fixed. After the process, you should restart your MySQL Daemon:

root@server:~# service mysql restart

Or for MariaDB:

root@server:~# service mariadb restart

From now on, everything should work as expected again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s