Laravel 5.8 Access denied for user 'root'@'localhost' (using password: YES)

Posted 2 months ago by calin.ionut

I can`t connect to the db from my laravel 5.8 app. It complains:

production.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

The credentials from .env are correct:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=test_db
DB_USERNAME=root
DB_PASSWORD=1234#

The server is running ubuntu 18.04 and mysql 5.7.25

Why is access denied???? If i loggin using:

mysql -u root -p

and give the password (1234#) works for the user root.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.