I got an error while I try to connect to MySQL:
PDOException in MySqlConnector.php line 41:
SQLSTATE[#4200]: <>: 1044 Access denied for user ‘xxx’@’%’ to database ‘yyy
;’
My .env file looks like this:
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=yyy
DB_USERNAME=xxx
DB_PASSWORD=***
I’ve tested:
- I can access via phpMyAdmin, but no throughout my code.
- Changing PHP version from 7.1 to 5.6
- Deleting and creating new database.
- Changing password.
- Using quotes for variable DB_USERNAME=“xxx”
- Using the user showed in phpMyAdmin:
- User: xxx@2a02:4780:bad:zzzz::14
- xxx@%
- Using DB_HOST with: