Can you give me python dash code to how to connect to the aws rds for sql server?

0

I am trying to connect to the aws rds for sql server and upload a dataset(csv) from my local machine if i am a IAM (having mfa authentication) user and not a root user. I am not sure which and all credentials i need to pass. Now I am passing endpoint, database name, username and the password. But if i am a IAM user, which and all credentials i need to pass?

azure_server = os.environ.get('SERVER_NAME')
azure_database = os.environ.get('DATABASE_NAME')
azure_username = os.environ.get('ADMIN_USERNAME')
azure_password = os.environ.get('ADMIN_PASSWORD')
if sql_type == "aws-sql":
            cnxn = pymssql.connect(server=user_server,user=username, password=password, database=db)

Also after passing necessary credentials, it's throwing below error : Database connection failed due to (18456, b"Login failed for user 'musigma'.DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (munlq.csgknz7x9y0v.us-east-1.rds.amazonaws.com)\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (munlq.csgknz7x9y0v.us-east-1.rds.amazonaws.com)\n")

I have allowed all traffic. I have attached screenshot for your reference. RDS SQL server main page

asked 8 months ago120 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions