Monday, February 28, 2022

AWS fixing database errors

This is a good link that is explaining how to do this

 https://aws.amazon.com/premiumsupport/knowledge-center/lightsail-wordpress-fix-database-errors/


Open ssh terminal
vi wp-config.php

Make sure it has the below details

define('WP_ALLOW_REPAIR', true);
define('DB_HOST', '127.0.0.1');
define('DB_NAME','bitnami_wordpress');
define('DB_USER','user');
define('DB_PASSWORD','29wbpY4HjUOu')

Save it by ESC + wq!

Now run mysite.in/wp-admin/maint/repair.php
Or try launching mysite.in/wp-admin

If still does not work, try to connect to the db manually from the terminal by the below command

sudo mysql 'bitnami_wordpress' -h 'localhost' -u 'user' -p
29wbpY4HjUOu

Now if this gives the below error, such as socket error.

In that case, restart  the running services in bitnami

sudo /opt/bitnami/ctlscript.sh status
sudo /opt/bitnami/ctlscript.sh restart
sudo /opt/bitnami/ctlscript.sh status


Now if this does not work,

Reboot the server as well from lightsail console.

If the site does not come up still, we nee to remove the plugins. This can be done by removing the plugins from the file system which is at this path 

/bitnami/wordpress/wp-content/plugins

No comments:

Post a Comment