简体   繁体   English

远程连接到在Amazon EC2实例上运行的mysql

[英]Connect Remotely to mysql running on a Amazon EC2 Instance

I'm trying to connect MySQL Workbench to an Amazon EC2 (Linux) instance that hosts a MySQL Database. 我正在尝试将MySQL Workbench连接到托管MySQL数据库的Amazon EC2(Linux)实例。 (Not RDS but localhost). (不是RDS,而是本地主机)。 However for some reason, I can't get it to connect remotely. 但是由于某种原因,我无法使其远程连接。

Things Ive done: - Set the security group to allow any IP to access port 3306 - Created a mysql user and granted all privledges on it. 我已经做过的事情:-设置安全组以允许任何IP访问端口3306-创建了一个mysql用户并授予了所有特权。 - Modified the my.cnf to include bind-address=0.0.0.0 However i still cant connect. -修改了my.cnf,使其包含bind-address = 0.0.0.0。但是我仍然无法连接。

On this instance I do have SSL cert installed and I am forwarded all http request to https?.. But im not sure if this has anything to do with it. 在这个实例上,我确实安装了SSL证书,并且将所有http请求转发到https?。但是我不确定这是否与此有关。

If anyone could guide my in the righ direction I would appreciate it. 如果有人能指导我迈向正确的方向,我将不胜感激。

I would personally give it an Elastic IP so it will have a public IP, then bind the mysql to that IP. 我个人会给它一个弹性IP,这样它将有一个公共IP,然后将mysql绑定到该IP。 Make sure the iptables are set to accept the mysql connections. 确保将iptables设置为接受mysql连接。 I also wouldnt suggest leaving mysql open to every ip unless this is an absolute necessity. 我也不会建议让mysql对每个IP开放,除非这是绝对必要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM