I’m trying to use bedrock for first time but I have a problem with connecting to the mysql database. My database connection section in .env file looks like this
The credentials are working. I also tried to use the DATABASE_URL method. I also tried changing localhost to 127.0.0.1 and 127.0.0.1::3306 but it doesnt work either.
The weirdest part is it looks like these values aren’t even used - my mysql log shows this:
Connect @localhost on
Connect Access denied for user ‘’@‘localhost’ (using password: NO)
But the .env file should be processed by the sever, because if I try and remove database section from .env file I get a 500 error saying I’m missing DB_NAME for example in my config file.
Do you have any idea what could be causing this problem?
Could you describe how it doesn’t work? It’s not clear to me here where you’re encountering the inability to log in, or what error it’s generating. Is it during the in-browser WordPress setup process? Or somewhere else? The .env file is only going to be parsed by PHP requests running through Bedrock/Wordpress.
I dont even get to the installation process. Everything shows the default WordPress database error in the browser: Error Establishing a Database Connection
Unfortunatelly it doesn’t work even with fresh .env file … I’ve even tried different web-server with different database credentials … Basically what I do is:
Create database, database user and test the credentials
When I go and investigate what credentials it uses to connect the database I find this line in mysql error log: Connect Access denied for user ‘’@‘localhost’ (using password: NO)
If I try and manually create wp-config.php in /web/wp/wp-config.php and fill in the database credentials - it works and it gets me to the wordpress installation.