root 用户访问 mysql 数据库被拒绝
当我使用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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
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
你的 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.
我遇到了同样的问题,服务器表已经在那里了。结果,sequel pro 需要指定套接字 url。
因此,登录到 mysql 中的终端:
然后通过输入
\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:
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.