【问题标题】:When I type "php artisan migrate" in terminal, I see error当我在终端中输入“php artisan migrate”时,我看到了错误
【发布时间】:2018-05-31 03:15:36
【问题描述】:

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

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

在 phpMyAdmin 上面写的所有东西 => 服务器:本地主机:8889

mamp pro 运行时的本地主机地址 => http://localhost:8888/phpMyAdmin/

在 phpMyAdmin => 数据库名称:laravel 用户名:root 通过:1234

【问题讨论】:

标签: php mysql laravel laravel-5.5


【解决方案1】:

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

想法:

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

【讨论】:

    【解决方案2】:

    尝试改变 DB_HOST=127.0.0.1DB_HOST=localhost

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-11-18
      • 2020-06-08
      • 1970-01-01
      • 2018-08-04
      • 2023-03-13
      • 2020-11-27
      • 2016-05-14
      相关资源
      最近更新 更多