1

When i try to go on my app, i have this message :

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost'

But when i make php artisan migrate, that work and tables are create on my local database ...

When i open mysql, i have :

Service : Mysql@localhost:3306
User : root
Password : ****

and my .env

APP_NAME=Laravel
APP_ENV=development
APP_KEY=**********************************
APP_DEBUG=true
APP_URL=localhost
TELESCOPE_ENABLED=true

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=root
DB_PASSWORD=root
Citizen Patrol
  • 260
  • 3
  • 13
Simon
  • 21
  • 5

1 Answers1

-1

You need to set a permission:-

try: GRANT ALL PRIVILEGES ON * . * TO 'your_user'@'localhost';

The error on your site now is the permission denied.

Arpit Jain
  • 1,217
  • 8
  • 27
  • not working, i tried `GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost';` but i have the same problem. Same with `GRANT ALL PRIVILEGES ON mydatabase.* TO 'root'@'localhost';` – Simon Mar 09 '20 at 08:00
  • @YannChapuis Can you please try with this ```php artisan config:clear``` and then open mysql – Arpit Jain Mar 09 '20 at 08:25