我在服务器上迁移表时遇到问题

时间:2019-10-09 11:18:05

标签: laravel

当我尝试迁移表时遇到此错误,请帮助,我试图通过ssh在数字海洋上部署laravel应用程序

在Connection.php第665行:

 SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select
  * from information_schema.tables where table_schema = alfingast and table_name
   = migrations and table_type = 'BASE TABLE')

在Connector.php第70行中:

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

1 个答案:

答案 0 :(得分:0)

确保已使用db配置.env文件。

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=root
DB_PASSWORD=

随后运行php artisan config:cache

然后运行php artisan migrate

查看更多信息SO answer