Linux – centos thesql keeps crashing, what to do

centosdedicated-serverlinuxMySQLsql

I recently got a dedicated server under CentOS with OVH. Everything has been working fine since 2 months, but starting a few days ago mysql keeps crashing and that causes various problems with my forum.

What do I need to do to start investigating? Is there a log file somewhere that will tell me why mysql crashed? Can I know the server load when mysql crashed, or if the server was executing a slow query?

Every time I check the server load seems to be fine (equals or under 1).

My server = i3 2130 / 2 cores / 8gb ram / dedicated

Best Answer

Check under /var/lib/mysql for .err files.

Turn off MySQL and run repair commands:

  1. Identify all corrupted tables using myisamchk

    myisamchk /var/lib/mysql/bugs/*.MYI >> /tmp/myisamchk_log.txt

  2. Repair the corrupted table using myisamchk

    myisamchk -r profiles.MYI

  3. Perform check and repair together for entire MySQL database

    myisamchk --silent --force --fast --update-state /var/lib/mysql/bugs/*.MYI

We need more information to better help you. Ideally, you might want to hire a DB admin to avoid data loss or more corruption.

You might have a bad drive. You might need to also run fsck. You might have bad RAM.

Honestly, there are so many things that could be causing this. I would hire an admin.

Related Topic