Error while connecting to MySQL through Laravel app

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:

  1. I can access via phpMyAdmin, but no throughout my code.
  2. Changing PHP version from 7.1 to 5.6
  3. Deleting and creating new database.
  4. Changing password.
  5. Using quotes for variable DB_USERNAME=“xxx”
  6. Using the user showed in phpMyAdmin:
  • User: xxx@2a02:4780:bad:zzzz::14
  • xxx@%
  1. Using DB_HOST with:

Can you try again ??

Same error.
I forgot to say that it’s not a remote connection. It’s local.
The project is uploaded in public_html/api folder.

I would head over to Laravel forums; I am yet to see an installation of it work here sorry.