laravel php artisan migrate 数据迁移时出现的[HY000][1045]错误

(zz找了块一个小时才发现)主要的错误在于.env文件和database.php的配置不匹配。

1.找到.env文件

2.更改数据库表账密

3.改database.php的数据库账密

 4.完成

总结: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   |
+---------------------+-------+

  

2.laravel 中.env配置和databases.php中配置对应,如上图,

3.删除本地数据库,重新执行PHP artisan miragate 命令

原文地址:https://www.cnblogs.com/lxwphp/p/15454283.html