简体   繁体   English

远程连接到基于aws-windows实例的MySQL数据库

[英]Remotely connect to an aws-windows instance based MySQL Database

  1. I have launched an AWS EC2 Windows_Server-2016 instance. 我已经启动了一个AWS EC2 Windows_Server-2016实例。
  2. Since this server is windows based ,I can successfully connect to it using remote desktop connection by entering the username, password and a .ppk file. 由于此服务器基于Windows ,因此我可以通过输入用户名,密码和.ppk文件,使用远程桌面连接成功连接到该服务器。
  3. I have installed MySQL server on the instance and created a user that is allowed to login with any ip ie by providing the '%' sign. 我已经在实例上安装了MySQL服务器,并创建了一个允许使用任何IP登录的用户,即通过提供“%”符号。
  4. Here's what my AWS instance security group looks like : 我的AWS实例安全组如下所示: 在此处输入图片说明

  5. I have tried connecting to the MySQL server using SQLYOG using 2 different scenarios : 我尝试使用2种不同情况使用SQLYOG连接到MySQL服务器:

    1. Tried connecting by using the aws public ipv4 address as a host field and using mysql username & password 尝试通过使用AWS公共ipv4地址作为主机字段并使用mysql用户名和密码进行连接
    2. Tried connecting by creating an SSH connection ie providing server username/password and .ppk file in SSH connection panel & then providing mysql host/username and localhost in mysql connection panel 尝试通过创建SSH连接进行连接,即在SSH连接面板中提供服务器用户名/密码和.ppk文件,然后在mysql连接面板中提供mysql主机/用户名和localhost

    None of the methods used allows me to connect.I try same procedure with a linux based server and can connect successfully. 所使用的方法均不允许我进行连接。我在基于linux的服务器上尝试相同的过程,并且可以成功连接。 Please let me know where am I going wrong while using a windows based MySQL hosting. 使用基于Windows的MySQL托管时,请告诉我哪里出了问题

MySQL has an extra level of IP protection for remote clients. MySQL为远程客户端提供了更高级别的IP保护。 You have to GRANT access to the remote ip (your house of office) to be able to connect. 你必须GRANT访问remote ip (你的办公用房),才能进行连接。 As root, you have to do : 作为根,您必须执行以下操作:

GRANT ALL ON <db>.* TO '<username>'@'<remote ip>' IDENTIFIED BY '<remote_password>';

Where is the DB you are trying to connect to etc. 您要连接到的数据库在哪里等

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

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