拒绝用户“”@“localhost”的访问

j2cgzkjk  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(362)

我正在尝试连接数据库,但遇到了类似用户“”@“localhost”的访问被拒绝这样的问题。有人能帮我解决这个问题吗?

Your connection attempt failed for user 'xxx' from your host to server at localhost:3306:
  Access denied for user 'xxx'@'localhost'

Please:
1 Check that mysql is running on server localhost
2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the xxx has rights to connect to localhost from your address (mysql rights define what clients can connect to the server and from which machines) 
4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you're connecting from
rt4zxlrg

rt4zxlrg1#

必须创建用户@localhost

Create user 'xxx'@'localhost' identified by password 

GRANT ALL PRIVILEGES ON *.* TO 'xxx'@'localhost'

相关问题