gpt4 book ai didi

mysql - 用户 'xxx' 的访问被拒绝 @'localhost'

转载 作者:行者123 更新时间:2023-11-29 10:04:09 25 4
gpt4 key购买 nike

我正在尝试连接数据库,但遇到类似用户“xxx”@“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

最佳答案

您必须创建用户 xxx@localhost

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

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

关于mysql - 用户 'xxx' 的访问被拒绝 @'localhost',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52268545/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com