当我在终端输入“php artisan migrate”时,我看到以下错误:
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)
我正在使用mac和Mamp Pro,
**其他一些信息:** php artisan serve => Laravel开发服务器启动: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
在phpMyAdmin中所有东西的顶部写的=>服务器:localhost:8889
mamp pro ran => http://localhost:8888/phpMyAdmin/时的本地主机地址
在phpMyAdmin => DB name:laravel用户名:root Pass:1234
当您的凭据无法连接到已定义的sql主机时,会发生这种情况。
思路: