wp-options keep crashing please help

My wp-options keeps crashing and am getting "error establishing a database connecting" when I try loading the page. I don't know whats causing this to happen, I read somewhere that I might need more ram so i upgraded my plan to get 2GB of ram 40GB of space. But today it crashed again, I repaired it and went to the error logs and this the same error i get when the wp-option crashes

[14-Sep-2016 11:07:38 UTC] WordPress database error Table './DATABASE_Name/wp_options' is marked as crashed and should be repaired for query INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_mom_share_plusone_2020', '0', 'no') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`) made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/WDXYZ/single.php'), mom_single_post_content, mom_posts_share, set_transient, add_option

Please help me fix this issue.

Topic vps php options Wordpress

Category Web


Are you running Jetpack? If so, try updating it. See this:

https://wordpress.org/support/topic/jetpack-sync-killing-the-db/


It sounds like you may be running a plugin that stores too many transient options. If you can't currently access wp-admin, try FTP'ing in and renaming your /plugins folder to disable all plugins. Then you should be able to log in to wp-admin. Next, back in FTP rename your /plugins folder back to the normal /plugins, and leave all of the plugins deactivated in wp-admin.

From there, go into phpMyAdmin and view the options table. Go to the last few pages and see if you notice any patterns - you may be able to tell which plugin is storing too much in the database, and then the solution is to remove the plugin and replace it with an alternative if you really need the functionality. Once you've found the culprit, run WP-Optimize ( https://wordpress.org/plugins/wp-optimize/ ) to clean up your database and reduce its size. It's a great plugin to run on a regular basis to keep things running smoothly.


I have find out that you can run cron job to automatically repair and optimize the database for you. By simply running this 2 cron jobs. You will have to create a .db_shadow file in your cpanel public_html and have the permission set to 0400 and past your root password.

mysqlcheck -Aos -u root -p"$(< .db_shadow)" > /dev/null 2>&1

/usr/bin/mysqlcheck -Aao --auto-repair -u root -p"$(< .db_shadow)"

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.