0
votes

When I type "php artisan migrate" in terminal I see the error below:

In Connection.php line 664:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations)           



In Connector.php line 67:

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

I'm using mac and Mamp Pro,

**Some other informations: ** php artisan serve => Laravel development server started: http://127.0.0.1:8000

.env file =>

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=1234

In phpMyAdmin top of all things writed => Server: localhost:8889

Local host address when mamp pro ran => http://localhost:8888/phpMyAdmin/

In phpMyAdmin => DB name: laravel Username: root Pass: 1234

2
php artisan config:clearLeo
what is your db password? in mysql its default blank....kaushik

2 Answers

0
votes

This happens when your credentials cannot connect to the defined sql host.

Ideas:

  1. Can you connect with your db credentials using Sequel Pro? https://www.sequelpro.com.
  2. Be sure you grant laravel db permissions for your user.
0
votes

Try changing DB_HOST=127.0.0.1 to DB_HOST=localhost