python3 sqlalchemy pymysql connect string
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: using python3, I can connect to mysql using pymysql. all works as expected. enclosed code works. import pymysql conn = pymysql.connect(host='127.0.0.1', unix_socket='/home/jhgong/mysql/tmp/mysql.sock', user='root', passwd='my_pass', db='my_db', port='3333') cur = conn.cursor() cur.execute('select user from auth_users') for i in cur: print(i) trying to get sqlalchemy to connect with pymysql, the default example strings don't seem to work. the above example does not work unless I declare both the port number and a unix_socket. below is what I