(zz找了块一个小时才发现)主要的错误在于.env文件和database.php的配置不匹配。
1.找到.env文件
![laravel php artisan migrate 数据迁移时出现的[HY000][1045]错误](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
2.更改数据库表账密
![laravel php artisan migrate 数据迁移时出现的[HY000][1045]错误](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
3.改database.php的数据库账密
![laravel php artisan migrate 数据迁移时出现的[HY000][1045]错误](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
4.完成
![laravel php artisan migrate 数据迁移时出现的[HY000][1045]错误](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
总结:php artisan migrate 只有两个表migrations和“users”,没有password_resets表
1.将数据库中 Innodb_large_prefix设置为1
mysql> show variables like ‘innodb_large_prefix’
+———————+——-+
| Variable_name | Value |
+———————+——-+
| innodb_large_prefix | OFF |
+———————+——-+
![laravel php artisan migrate 数据迁移时出现的[HY000][1045]错误](https://javaforall.net/wp-content/uploads/2020/11/2020110817443450.jpg)
2.laravel 中.env配置和databases.php中配置对应,如上图,
3.删除本地数据库,重新执行PHP artisan miragate 命令
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/113218.html原文链接:https://javaforall.net
