无法创建迁移(Laravel Framework 9.17.0)
我想将MySQL数据库连接到没有XAMPP的Laravel项目(使用Ubuntu 22.04)。 我创建了一个名为my_project的数据库,并将其添加到.env文件中
在创建迁移的旁边我使用了工匠命令:PHP工匠迁移
。 作为输出,它返回
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = my_database and table_name = migrations and table_type = 'BASE TABLE')
有什么想法我可能做错了什么?
I want to connect the MySQL database to the Laravel project without XAMPP (Using Ubuntu 22.04).
I created a database called my_project and added it to.env file
Up next to create migrations I used artisan command: php artisan migrate
.
As an output it returned
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = my_database and table_name = migrations and table_type = 'BASE TABLE')
Any ideas what I might be doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,我父亲找到了我问题的答案:D
问题在于仅为Localhost提供数据库用户赠款。
但是,需要授予它,以便可以从任何IP连接。
Apparently, my dad found the answer to my problem :D
problem was in giving my database user grant only for localhost.
However, it needs to be granted so it can be connected from any IP.
您可以尝试通过执行清洁缓存
You can try cleaning the cache by doing