root 用户访问 mysql 数据库被拒绝

发布于 2024-08-24 22:51:42 字数 121 浏览 14 评论 0原文

当我使用sequel pro 连接到远程数据库时,服务器显示访问被拒绝。我 100% 确定用户名和密码正确。我还尝试使用 phpmyadmin 连接到服务器,它有效。我不知道当我使用sequel pro连接到服务器时发生了什么。

when i am using sequel pro to connect to a remote database, the server says access denied. I am 100% percent sure that the username and password are correct. I also try to use phpmyadmin to connect to the server, it works. I don't know what happened when I am using sequel pro to connect to the server.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

岛徒 2024-08-31 22:51:42

mysql 身份验证不仅取决于登录名+密码,还取决于主机。
使用登录名“root”和您想要的任何密码以及必要的(或任何“%”)主机创建另一个用户

mysql authentication depends not only of login + password but of host too.
create another user with login "root" and any password you want and necessary (or any "%") host

王权女流氓 2024-08-31 22:51:42

你的 MySQL 服务器可能只允许在本地主机上进行 root 登录,我相信这是默认的。

由于 phpMyAdmin 通过在 SQL 服务器上运行的 Web 服务器来反弹连接,因此根连接将显示为来自本地主机并被接受。

Your MySQL server probably only allows root logins on localhost, as I believe is default.

Since phpMyAdmin is bouncing the connection through a webserver running on the SQL server, the root connection will appear to be coming from localhost and be accepted.

草莓味的萝莉 2024-08-31 22:51:42

我遇到了同样的问题,服务器表已经在那里了。结果,sequel pro 需要指定套接字 url。

因此,登录到 mysql 中的终端:

mysql -u root

然后通过输入 \s 获取 mysql 状态

找到您的 UNIX 套接字路径,将其复制并粘贴到 Sequel Pro 中的“套接字”字段。

那对我来说是这样的。

I had the same problem, and the servers table was already there. Turned out sequel pro needed to have the socket url specified.

So log in to terminal in mysql:

mysql -u root

Then get mysql status by typing \s

Find what your UNIX socket path is, copy that and paste to the "socket" field in Sequel Pro.

That did it for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文