无法从 Windows GUI 工具连接到远程 Linux 服务器上的 MySql 数据库
我已经在 Amazon EC2 上的 Linux 服务器上设置了 mysql 数据库。这在本地效果很好。我可以登录 linux 盒子并管理 mysql 数据库
我正在尝试将本地 GUI 客户端连接到远程 mysql,但连接失败。
我更新了 /etc/mysql/my.cnf 文件并更改了以下内容:
skip-networking
bind-address = 0.0.0.0
我仍然无法连接。有什么想法吗?
编辑:我首先尝试了bind-address=0.0.0.0,然后我添加了带有bind-address的skip-networking
编辑#2:我确保安全组在3306上打开我还打开了其他可用的端口,所以我认为这不是亚马逊特定的问题。
I have setup a mysql database on a linux server on Amazon's EC2. This works well locally. I can log into the linux box and administer the mysql database
I am trying to connect my local GUI client to the remote mysql and it is failing to connect.
I updated the /etc/mysql/my.cnf file and changed the following:
skip-networking
bind-address = 0.0.0.0
I am still not able to connect. Any thoughts?
EDIT: I first tried bind-address=0.0.0.0 , then I added skip-networking with bind-address
EDIT #2: I made sure the security group opens on 3306. I also have other ports open which work so I dont think its an amazon specific issue
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我一般不建议您打开端口 3306 进行公共访问(甚至 IP 限制)。我个人总是使用 Putty/ssh 隧道端口 3306,然后使用 localhost 连接到数据库。
在这种情况下,不要忘记像这样为用户授予权限:
如果您仍然想进行直接连接,则可能是您的用户仍然没有足够的权限。你可以试试这个:
I generally don't recommend you to open port 3306 for public access (or even with IP restrictions). I personally always tunnel port 3306 with Putty/ssh and then just use localhost to connect to the database.
In this case don't forget to grant privileges for the user like this:
If you still want to make direct connection, it's possible, that your user still don't have enough privileges. You can try this: