Hello,
I suddenly started getting an 'Error establishing a database connection' error on load of my WooCommerce site which is hosted on CyberPanel under Centos 8.
To understand what's going on, I've put the following in wp_config.php:
define('WP_ALLOW_REPAIR', true);
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true);
That uncovered the following stack trace:
( ! ) Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'w8WI11jpe3wGCO'@'localhost' (using password: YES) in /home/mydomain.com/public_html/wp-includes/wp-db.php on line 1653
Call Stack
# Time Memory Function Location
1 0.0009 372512 {main}( ) .../repair.php:0
2 0.0012 373000 require_once( '/home/mydomain.com/public_html/wp-load.php' ) .../repair.php:10
3 0.0015 373400 require_once( '/home/mydomain.com/public_html/wp-config.php' ) .../wp-load.php:37
4 0.0025 374800 require_once( '/home/mydomain.com/public_html/wp-settings.php' ) .../wp-config.php:84
5 0.0546 832240 require_wp_db( ) .../wp-settings.php:124
6 0.0610 836424 wpdb->__construct( ) .../load.php:527
7 0.0610 836424 wpdb->db_connect( ) .../wp-db.php:632
8 0.0611 838000 mysqli_real_connect ( ) .../wp-db.php:1653
Access denied for user 'w8WI11jpe3wGCO'@'localhost' (using password: YES)
Error establishing a database connection
I seem to be able to access the DB via the phpMyAdmin UI through CyberPanel and there I can see that in the DB that seems to be associated with my WordPress app (w8WI11jpe3wGCO) there's an option to change a password at the following URL: https://mydomain.com:8090/phpmyadmin/server_privileges.php?username=w8WI11jpe3wGCO&hostname=<myIP>.
I attempted to change the password to the one in the wp_config.php.
After rebooting Lightspeed server and retry, the erroneous behavior still persists.
How can I recover from this?
Why wouldn't the application start while the DB is perfectly accessible via phpMyAdmin?
I'd appreciate if anyone could guide me at fixing this issue.
Thank you in advance.
Comments
Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'w8WI11jpe3wGCO'@'localhost' (using password: NO) in /home/mydomain.com/public_html/wp-includes/wp-db.php on line 1653
Awaiting a response (with a bated breath)
Best option is to search for 'mysqli_real_connect(): (HY000/1045): Access denied for user' via Google.
This was the first entry for me: https://stackoverflow.com/questions/46736319/phpmyadmin-error-mysqli-real-connect-hy000-1045-access-denied-for-user-p
Ok, it was an error in PHPmyadmin, but it may provide clues. You may have to go direct into mysql and rejig the affected user details. Does not seem a terminal problem.
Did you make any changes to your server, CyberPanel or your WooC set-up prior to the database connection suddenly stopping?
FWIW I have installed CyberPanel, had a few issues, and now reckon the best option is to install OLS etc manually and learn proper SysAdmin via official documentation rather than rely on forums, free 1-click installs etc.
Sorry I can't be of more help.