【问题标题】:What is the error when migrating Laravel?迁移 Laravel 时出现什么错误?
【发布时间】:2020-08-02 02:40:24
【问题描述】:
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

这可能是什么问题? 附言不,清除缓存/配置没有帮助!

【问题讨论】:

  • 你是否在mysql中创建了数据库laravel_blog
  • 正如@TimBrownlaw 所说,错误返回的错误非常清楚。您需要弄清楚自己的凭据是什么。
  • php 工匠配置:清除
  • .env 更改后需要重启服务器
  • @TimBrownlaw,那么如何进入/使用另一个用户下的数据库?

标签: php mysql laravel mamp


【解决方案1】:

我发现错误是什么,也许有人会告诉你:在 config.inc.php 中,我注册了 'root' 和密码 - 新创建的条目,而不是用户,在它下面并在 . env 文件 - 一切正常

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-02
    • 1970-01-01
    • 2018-05-03
    • 2021-10-20
    • 1970-01-01
    • 1970-01-01
    • 2019-02-14
    • 2013-12-07
    相关资源
    最近更新 更多