3

I want to access the sql server using the amazon web services. How do I do it? I have tried this using mysql.connecter in python.

import mysql.connecter
conn=mysql.connector.connect(host="hostname",database="datbasename",user="root",password="a")
if conn.is_connected():
    print('connected to mysql database')
Cœur
  • 37,241
  • 25
  • 195
  • 267
abhinayak
  • 143
  • 2
  • 8
  • 3
    Maybe share the error you're having?.. And what is SQL server in AWS? Is it RDS? EC2? – Henry Jul 09 '17 at 17:01
  • its ec2.where do i get the host name ,database name and all.. – abhinayak Jul 09 '17 at 17:14
  • Well, you configure the db name. The hostname will be the EC2 instance IP address. – Henry Jul 09 '17 at 17:24
  • Thanks sir , but please can u help me on what must the host name and password must be...i have searched this a lot but didn't get anything ....Thanks. – abhinayak Jul 10 '17 at 07:31
  • You should have configured them yourself, or they are the default SQL server ones. I dont know which, but I definitely cant just 'tell you' them – Henry Jul 10 '17 at 08:03

0 Answers0