且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

[PDOException]-SQLSTATE [HY000] [1045]用户'root'@'ip'的访问被拒绝(使用密码:是)

更新时间:2022-04-21 21:56:19

当您连接到AWS时,您将通过SSH连接到虚拟化Linux服务器上的unix shell帐户.

When you connect to AWS you're connecting to a unix shell account on a virtualize linux server via SSH.

在此虚拟服务器(或其他服务器)上,您正在运行数据库应用程序的实例.此数据库应用程序也是也是服务器.但是,它具有自己的凭证系统.当您看到此错误消息

On this virtual server (or maybe another server), you're running an instance of a database application. This database application is also a server. However, it has its own credential system. When you see this error message

[PDOException]
SQLSTATE [HY000] [1045]对用户'user'@'ip'的访问被拒绝(使用密码:是)

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'user'@'ip' (using password: YES)

这是PHP/Laravel告诉您

This is PHP/Laravel telling you

嘿,我尝试使用app/config/database.php文件中的凭据连接到数据库,但是服务器告诉我那些凭据无效.

Hey, I tried to connect to the database with the credentials in my app/config/database.php file, but the server told me those credentials were invalid.

换句话说,您为"user"配置的密码与实际密码不匹配,或者"user"帐户无权从IP地址访问数据库服务(MySQL?) PHP正在运行.

In other words, the password you configured for "user" didn't match the actual password, or the "user" account isn't authorized to access the database service (MySQL?) from the IP address PHP is running.

使用正确的数据库凭据,您的错误将消失.使用命令行mysql程序测试您的数据库凭据.

Use the correct database credentials, and your error will go away. Use the command line mysql program to test your database credentials.

希望这足以让您使用Google进行正确的搜索! :)

Hopefully that's enough to get you Google-ing for the right thing! :)