I had installed wordpress on ubuntu 20.04 on 2GB/2CPU and I have a problem with my MySQL server that keeps crashing. Everyday we are getting below error :

error establishing a database connection and after refreshing the site, error gone but reappear after sometime.

2021-08-20T15:35:54.676626Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.26-0ubuntu0.20.04.2) starting as process 47806
2021-08-20T15:35:54.715129Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-08-20T15:35:55.518494Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-08-20T15:35:55.889880Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2021-08-20T15:35:55.910933Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2021-08-20T15:35:55.968155Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-08-20T15:35:55.968416Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-08-20T15:35:55.972738Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-08-20T15:35:55.973735Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-08-20T15:35:56.049092Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2021-08-20T15:35:56.049283Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.26-0ubuntu0.20.04.2'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu).
2021-08-20T15:35:56.358145Z 8 [ERROR] [MY-013134] [Server] Table './database_name/wprd_postmeta' is marked as crashed and should be repaired
2021-08-20T15:35:56.367954Z 8 [Warning] [MY-010756] [Server] Checking table:   './database_name/wprd_postmeta'
2021-08-20T15:35:56.396138Z 10 [ERROR] [MY-013134] [Server] Table './database_name/wprd_options' is marked as crashed and should be repaired
2021-08-20T15:35:56.397423Z 10 [Warning] [MY-010756] [Server] Checking table:   './database_name/wprd_options'
2021-08-20T15:35:56.759102Z 9 [ERROR] [MY-013134] [Server] Table './database_name/wprd_ahm_sessions' is marked as crashed and should be repaired
2021-08-20T15:35:56.759734Z 9 [Warning] [MY-010756] [Server] Checking table:   './database_name/wprd_ahm_sessions'
2021-08-20T15:35:57.341553Z 11 [ERROR] [MY-013134] [Server] Table './database_name/wprd_usermeta' is marked as crashed and should be repaired
2021-08-20T15:35:57.342417Z 11 [Warning] [MY-010756] [Server] Checking table:   './database_name/wprd_usermeta'
2021-08-20T15:36:05.715122Z 12 [ERROR] [MY-013134] [Server] Table './database_name/wprd_ahm_download_stats' is marked as crashed and should be repaired
2021-08-20T15:36:05.720212Z 12 [Warning] [MY-010756] [Server] Checking table:   './database_name/wprd_ahm_download_stats'

Database size is about 250MB

1 Answer 1


This can sometimes happen when a server runs out of storage space or if the storage medium itself has become corrupted. Check your server to make sure neither of these apply to you.

To repair the tables from the command line, you can run this command:

mysqlcheck --repair --all-databases

If you want to fix just specific tables in a database, connect to the server, switch to the database where your WordPress data is, then run this command:

REPAIR TABLE `{table name}`;

Be sure to replace {table name} with the actual table you’d like to repair. If you do not already have a recent backup of your WordPress database, now would be a good time to make one … after repairing your tables.

  • server doesn't run out of storage and also storage isn't corrupted. Also, I already repaired all database. Still the problem occur. I'm on digitalocean 2gb/2vcpu & 60GB SSD. Aug 21, 2021 at 10:59
  • The issue points to corruption somewhere. If needs be, grab your most recent backup, drop the database, create, then re-import the data 🤐
    – matigo
    Aug 21, 2021 at 11:05
  • does re-import solve the problem? Aug 21, 2021 at 11:29
  • Only you can answer that. I don’t have a duplicate of your environment to test with. That said, something is corrupted. All I can do is offer suggestions based on past experience.
    – matigo
    Aug 21, 2021 at 11:49
  • Let see i will re-import and thank you for you suggestions. I will msg with results after re-importing. Aug 21, 2021 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.