【问题标题】:Laravel 5.4 with MySQL 8 migration errorLaravel 5.4 与 MySQL 8 迁移错误
【发布时间】:2018-12-06 22:07:41
【问题描述】:

我已将 laravel 5.4 项目克隆到安装了 MySQL 8 的 Mac 上,每当我尝试运行 php artisan migrate 时,都会收到以下错误:

有什么建议吗?

【问题讨论】:

标签: mysql laravel-5 laravel-artisan artisan-migrate


【解决方案1】:

将用户设置回mysql 8.0版本的mysql_native_password

mysql -u root - p

然后

ALTER USER 'forge'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';

【讨论】:

    【解决方案2】:

    MySQL 8.0.4 将默认身份验证mysql_native_password 更改为caching_sha2_password

    mysqld.exe --initialize-insecure --default-authentication-plugin=mysql_native_password
    

    这将使用 root 用户初始化您的数据目录,而无需使用 mysql_native_password 的密码,这 laravel 实际工作。

    【讨论】:

      猜你喜欢
      • 2017-07-26
      • 2018-10-01
      • 1970-01-01
      • 2017-06-23
      • 1970-01-01
      • 2017-07-14
      • 2021-03-20
      • 2018-06-05
      相关资源
      最近更新 更多