简体   繁体   中英

How to connect Rstudio to AWS instance of mysql Database?

I have Rstudio and RMySQL package installed on my local system and i want to connect to my test server database hosted on AWS EC2. I am using the followinf command:

mysqlconnection = dbConnect(MySQL(), user='root', password='*****', 
        dbname='sakila', host='ec2-55-231-255-3.compute-1.amazonaws.com',port=1234)

but it gives error that cant connect to database. It is working all right for localhost. Please suggest what needs to be done.

您可能需要转到“安全组”,并将本地IP地址添加为允许的“入站”连接。

Amazon Webservices Dashboard > Networking > VPC > Networking and Security > Security Groups > Inbound (tab)

You need to add inbound IP of EC2 security group of EC2 instance/ machine. but How ??

  1. Go to EC2 service and select the instance you are using
  2. In description you can see "Security groups"
  3. Select the security group, it will open another page, which shows of the name and property of that same security group.
  4. Select inbound from bottom panel and add your local machine IP address into inbound

Hope it helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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