Fayakon
Fayakon

Reputation: 1523

Laravel: Access denied for user 'newuser'@'localhost' (using password: YES) (SQL: select * from `roles`)

i want to run my project with root user. but when i run my project,

i am getting error:

SQLSTATE[HY000] [1045] Access denied for user 'newuser'@'localhost' (using password: YES) (SQL: select * from `roles`)

in Connection.php line 647

.env:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=course
DB_USERNAME=root
DB_PASSWORD=

i want to use root with all privileges and no password, then why i am getting error:

SQLSTATE[HY000] [1045] Access denied for user 'newuser'@'localhost' (using password: YES) (SQL: select * from `roles`)

MySql:

enter image description here

Upvotes: 0

Views: 2104

Answers (2)

Joseph
Joseph

Reputation: 6269

You just need to clear your config cache files by running this command

php artisan config:clear

Upvotes: 1

Mortada Jafar
Mortada Jafar

Reputation: 3679

clear config cache

php artisan config:clear 

Upvotes: 2

Related Questions