无法从Windows GUI工具连接到MySQL数据库的远程Linux服务器上 [英] Unable to connect to MySql database on a Remote linux server from a windows GUI tool

查看:222
本文介绍了无法从Windows GUI工具连接到MySQL数据库的远程Linux服务器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装在Amazon的EC2在Linux服务器上的MySQL数据库。这种运作良好,在本地。我可以登录到Linux机器和管理mysql数据库

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

我想我的本地GUI客户端连接到远程MySQL,它是无法连接。

I am trying to connect my local GUI client to the remote mysql and it is failing to connect.

我更新了/etc/mysql/my.cnf文件,并更改如下:

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?

修改:我第一次尝试绑定地址= 0.0.0.0,然后我加跳过联网使用绑定地址

EDIT: I first tried bind-address=0.0.0.0 , then I added skip-networking with bind-address

编辑#2 :我确信安全组开上3306我也有其他的端口开放而工作,所以我不认为它是亚马逊的具体问题

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

推荐答案

我一般不建议您打开3306端口,供公众查阅(甚至有IP限制)。我个人一直隧道端口3306与腻子/ SSH,然后只用本地主机连接到数据库。

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:

grant all privileges on yourDatabaseName.* to 'yourUserName'@'localhost' identified by "yourUsersPassword";

如果你仍然想进行直接连接,这是可能的,您的用户还没有足够的权限。你可以试试这个:

If you still want to make direct connection, it's possible, that your user still don't have enough privileges. You can try this:

grant all privileges on yourDatabaseName.* to 'yourUserName'@'yourClientsIp' identified by "yourUsersPassword";

这篇关于无法从Windows GUI工具连接到MySQL数据库的远程Linux服务器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆