while using the sqlalchemy, unable to connect with sql server from databricks:
user='user@host.mysql.database.azure.com'
password='P@test'
host="host.mysql.database.azure.com"
database = "db"
connect_args={'ssl':{'fake_flag_to_enable_tls': True}}
connect_string = 'mysql+pymysql://{}:{}@{}/{}'.format(user,password,host,database)
engine = create_engine(connect_string, connect_args=connect_args, echo=False)
map = pd.read_sql("SELECT * FROM rig_emissions.tag_lookup", engine)
map['key'] = map['rig'].astype(str)+map['tagpath']
mapDict = dict(zip(map.key,map.id))
It returns the below error:
(pymysql.err.OperationalError) (2003, 'Can't connect to MySQL server on 'P@test' ([Errno -2] Name or service not known)')