当我在终端输入“php artisan migrate”时,我看到错误

问题描述 投票:0回答:1

当我在终端输入“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

php mysql laravel laravel-5.5
1个回答
0
投票

当您的凭据无法连接到已定义的sql主机时,会发生这种情况。

思路:

  1. 您可以使用Sequel Pro连接您的数据库凭据吗? https://www.sequelpro.com
  2. 确保您为用户授予了laravel db权限。
© www.soinside.com 2019 - 2024. All rights reserved.