How to Check and repair a corrupted MySQL database on CentOS server using SSH

Server problems many times can cause corruption of scripts and modules

So now we can see how check & repair MySQL database table through SSH.

Normally we use PhpMyAdmin to manage our MySQL databases.

1. First of all, you have to log in as root using SSH.

2. Now, you have to run this command to check the desired database.

# mysqlcheck -r [your-database-name]

Here, mysqlcheck command will check the database.
-r will repair the corrupted tables of the database.

3.If the above command does not work in any case then you can use myisamchk command:

# myisamchk -r /var/lib/mysql/[your-database-name]/*

 

Here, you should keep this thing in mind that MyISAM is the default storage engine for MySQL.
myisamchk command will check the database.
-r will repair the corrupted tables of the database.

Impostazioni sulla privacy salvate!
GDPR Center

When you visit a website, it can store or retrieve information on your browser, mainly in the form of cookies. Check your personal cookie services here.

Questi cookie sono necessari per il funzionamento del sito Web e non possono essere disattivati nei nostri sistemi.

Usiamo WooCommerce come sistema di acquisto. Per l'elaborazione del carrello e dell'ordine verranno memorizzati 2 cookie. Questi cookie sono strettamente necessari e non possono essere disattivati.
  • woocommerce_cart_hash
  • woocommerce_items_in_cart

Rifiuta tutti i servizi
Accetta tutti i servizi

Menu principale