Repair Mysql / MariaDB databases

Support Wissensdatenbank

Du bist hier:
Print

Repair Mysql / MariaDB databases

It may happen that MySQL server has unusually high load. Or when checking the tables you get the message: “Mysql going away…” and the MySQL server suddenly restarts. This indicates that there are technical problems with the databases.

Please make sure that there is no hardware damage (memory, hard drives, motherboard defective).

  1. journalctl | grep "marked as crashed and should be repaired" | tail
    Checks if there are defective databases.
  2. mysqlcheck -u admin -p`cat /etc/psa/.psa.shadow` --auto-repair --all-databases
    All tables will be repaired
  3. service mysql stop
    myisamchk -s /var/lib/mysql/*/*.MYI  (Checks if there are MyISAM Errors)
    myisamchk -o /var/lib/mysql/*/*.MYI  (Repairs MyISAM with HASH)
    myisamchk -r /var/lib/mysql/*/*.MYI  (Repairs MyISAM without HASH)
    myisamchk -s /var/lib/mysql/*/*.MYI  (Control)
  4. journalctl | grep "marked as crashed and should be repaired" | tail
    Should be empty now, if not, write down table names and then
  5. cd /var/lib/mysql
    find . -name 'tablename*'

    (Then log into Plesk and open the corresponding table under Tools & Settings => Databases Server => select database number => search for database => open database as end customer and click on repair)

If the database server MariaDB or MySQL no longer starts at all and the InnoDB storage is defective (Unknown/unsupported storage engine: InnoDB), the following entry must be made in my.cnf:

[mysqld]
innodb_force_recovery = 2

The database server must then be restarted. If this does not work, increase the recovery mode from 2 to 3 and so on until the MariaDB/ MySQL database server is working again.
 
Done. Just check from time to time if everything is OK.

War dieser Artikel hilfreich?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
Wie können wir diesen Artikel verbessern?
Please submit the reason for your vote so that we can improve the article.
Brauchst du Hilfe?
Related Post