简体   繁体   中英

Python Jupyter notebook- AWS RDS Mysql - Not able to connect

I am not able to connect AWS RDS mysql using juypter notebook but i can connect via SQL workbench. Can you please throw some light on the error below

Error Message :-

MSSQLDatabaseException: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist

import pymssql
 
connection={
       'host': 'xxxxx.cuwwncrvmjhg.us-east-1.rds.amazonaws.com',
    'username': 'xxxx',
    'password': 'xxxx',
    'db': 'mysql' 
 }


con=pymssql.connect(connection['host'],connection['username'],connection['password'],connection['db'])

From docs , I see in pymssql.connect you need to specify key=value. Can you try:

import pymssql
 
connection={
    'host': 'xxxxx.cuwwncrvmjhg.us-east-1.rds.amazonaws.com',
    'username': 'xxxx',
    'password': 'xxxx',
    'db': 'mysql' 
 }

con=pymssql.connect(server=connection['host'],user=connection['username'],password=connection['password'],database=connection['db'])

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