迁移Laravel时会出现什么错误?

时间:2020-04-19 16:54:40

标签: php mysql laravel mamp

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

尝试从数据库迁移到PhpMyAdmin时发生此错误。

我的.env文件:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=8889
DB_DATABASE=laravel_blog
DB_USERNAME=root
DB_PASSWORD=root

MySQL的MAMP起始页:

Host: localhost
Port: 8889
User: root
Password: root
Socket: /Applications/MAMP/tmp/mysql/mysql.sock

enter image description here

这里可能是什么问题? 附言不,清除缓存/配置无济于事!

1 个答案:

答案 0 :(得分:0)

我发现了错误所在,也许有人会告诉您:在config.inc.php中,我注册了“ root”和密码(而不是用户),即新创建的条目,进入了该条目并在下方注册了它。 env文件-一切正常