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

已提问 8 个月前126 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则