Error establishing a database connection

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=.

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.

P.S. I also tried configuring this user to have no password and granting him all privileges, but that doesn’t change the situation either, except for the error message now reading as:

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

I’d really appreciate it if someone knowledgeable from the cyberpanel team could suggest a fix for the described situation, I was thinking this was a go to place for anything CyberPanel and so far the response I’m getting hear is nothing spectacular. Thanks

Since this forum doesn’t have the ability to attach any pictures nor apply any reasonable editing to the messages, I’m adding a link where this issue is described more visually:

Awaiting a response (with a bated breath)

Might struggle to get an official CyberPanel answer here. The team seem to have disappeared as they start a new paid-for hosting service.

Best option is to search for ‘mysqli_real_connect(): (HY000/1045): Access denied for user’ via Google.

This was the first entry for me: php - phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) - Stack Overflow

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.

A technology whose team is nowhere to be found for its users is a dead technology.

This is the username or the password ? w8WI11jpe3wGCO