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 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南