Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitnami WordPress with NGINX and SSL - Error establishing a database connection #1120

Closed
glmworkemail opened this issue Aug 27, 2023 · 4 comments
Assignees
Labels
how-to How to issues reported by users solved stale 15 days without activity triage Triage is needed wordpress-nginx

Comments

@glmworkemail
Copy link

glmworkemail commented Aug 27, 2023

Describe your issue as much as you can

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 running

I ran sudo /opt/bitnami/ctlscript.sh restart mariadb just to make sure , Restarted mariadb

I tried ping 127.0.0.1 and it shows 30 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 version

After logging into MariaDB Server, i ran SHOW GRANTS FOR 'bn_wordpress'@'127.0.0.1'; and it says ERROR 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 returns Error 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
added define( 'WP_ALLOW_REPAIR', true );

After i go to 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.

@glmworkemail glmworkemail added the how-to How to issues reported by users label Aug 27, 2023
@github-actions github-actions bot added the triage Triage is needed label Aug 27, 2023
@glmworkemail
Copy link
Author

glmworkemail commented Aug 27, 2023

I just edited 'DB_USER' in wp-config.php to define('DB_USER','root'); root with app password and it worked. But it still doesn't make sense why it broke to begin with???

And leaving it this way can't be right, but I dont know how to make it work with user bn_wordpress

@gongomgra
Copy link
Collaborator

Hi @glmworkemail,

Thanks for using Bitnami. The password you get in the first run of the machine is also the password for the database root user. However, for security reasons, the WordPress application uses its own database credentials (user and password) in the wp-config.php file. If you have modified that value in the file by mistake and you don't remember its original value, please reset the database password for the bn_wordpress user and update the wp-config.php file accordingly.

Hope it helps!

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Sep 14, 2023
@github-actions
Copy link

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
how-to How to issues reported by users solved stale 15 days without activity triage Triage is needed wordpress-nginx
Projects
None yet
Development

No branches or pull requests

3 participants