且构网

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

用户'root'@'localhost'拒绝访问(使用密码:YES)

更新时间:2023-12-01 21:28:22

参考



连接失败的访问被拒绝的换用户rootlocalhost-使用-密码是 [ ^ ]


您尝试使用root用户名访问mysql数据库,但密码为空或密码错误。找出该数据库的有效用户名和密码,并相应地在连接字符串中更正它们。

顺便说一句,您不应该使用root帐户访问您的数据库,您应该创建一个单独的用户帐户,该帐户具有该数据库的有限权限。阅读:创建 - a-mysql-database-username-password-and-permissions-from-the-line-line [ ^ ]。
You have attempted to access the mysql database using root username but with empty or wrong password. Find out the valid username and password for that database and correct them in your connection string accordingly.
BTW, you should not use root account to access your database, you should create a separate user account with limited privileges for that database. Read this: create-a-mysql-database-username-password-and-permissions-from-the-command-line[^].