Bitnami WordPress with NGINX and SSL – Error establishing a database connection
-
The VM runs in Virtual Box on my personal PC at home, and while doing something unrelated, I restarted my PC (it probably warned me there was a VM running, and I probably said restart anyway). After the PC restarted, I started the VM again, but now when going to the website URL, I now get the error mentioned. Note before the PC shutdown, everything was working correctly.
It uses MariaDB.
sudo /opt/bitnami/ctlscript.sh status mariadb
it reads mariadb already runningI ran
sudo /opt/bitnami/ctlscript.sh restart mariadb
just to make sure , Restarted mariadbI tried
ping 127.0.0.1
and it shows30 packets transmitted, 30 received 0% packet loss
I tried
mysql -u root -p
and using the application password, successfully logs into MariaDB monitor and shows id and Server versionAfter logging into MariaDB Server, i ran
SHOW GRANTS FOR 'bn_wordpress'@'127.0.0.1';
and it saysERROR 1141 (42000) There is no such grant defined for user bn_wordpress on host 127.0.0.1 MariaDB
I tried
mysql -u bn_wordpress -h 127.0.0.1 -p
using the default password (and by default i mean the one we see when the VM first loads) , and it returnsError 1045 (28000): access denied for user 'bn_wordpress'@127.0.0.1 (using password: YES)
Also, inside wp-config.php, I changed the following:
define('WP_DEBUG',true); #it was false
addeddefine( 'WP_ALLOW_REPAIR', true );
After i go to https://www.yoursite.com/wp-admin/maint/repair.php , here’s what I get:
Warning: mysqli_real_connect(): (HY000/1045): Access denied for user ‘bn_wordpress’@’127.0.0.1’ (using password: YES) in /opt/bitnami/wordpress/wp-includes/class-wpdb.php on line 2019
Access denied for user ‘bn_wordpress’@’127.0.0.1’ (using password: YES)Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at 127.0.0.1:3306 could not be established. This could mean your host’s database server is down.Are you sure you have the correct username and password? No, I’m not sure bc i have recent edited this value, so i don’t know what it was originally (that was dumb). Does this need to be reset or something?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.
- The topic ‘Bitnami WordPress with NGINX and SSL – Error establishing a database connection’ is closed to new replies.