Misleading "Error establishing a database connection"
-
First, I am not a newbie and this is not the usual first time user error.
I try to run latest WordPress in a regular Docker container
tutum/lamp
and get this error message during installation – with correct database, user, pass:Error establishing a database connection This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
Why do I know the access data is correct? When I enter a WRONG database, I get this error message during installation:
Can’t select database We were able to connect to the database server (which means your username and password is okay) but not able to select the xwordpress database.
So the first error message is just a plain lie, it can connect, it has some other issues. It’s not “Error establishing a database connection”.
I checked the user rights on the MySQL user and they seem to be okay:
SHOW GRANTS FOR CURRENT_USER; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' IDENTIFIED BY PASSWORD 'a1b2c3' WITH GRANT OPTION
So what am I doing wrong? Why is WordPress behaving this way?
FEATURE REQUESTS:
1. Show a meaningful error message when something goes wrong with the database
2. Have a “[ ] Create database” checkbox during the installation process
- The topic ‘Misleading "Error establishing a database connection"’ is closed to new replies.