Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python InternalError:(pymysql.err.InternalError)(1193,“未知系统变量&”x27;“事务隔离&”_Python_Mysql_Sqlalchemy_Pymsql - Fatal编程技术网

Python InternalError:(pymysql.err.InternalError)(1193,“未知系统变量&”x27;“事务隔离&”

Python InternalError:(pymysql.err.InternalError)(1193,“未知系统变量&”x27;“事务隔离&”,python,mysql,sqlalchemy,pymsql,Python,Mysql,Sqlalchemy,Pymsql,尝试使用PyMySQL版本0.8.0从Python(版本3.6.5)将数据帧输出到MySQL数据库表中。SQLAlchemy版本1.2.17,数据库服务器为8.0.1 到目前为止,相同的代码一直运行良好。如有任何关于如何解决的建议,我们将不胜感激 pymysql.install_as_MySQLdb() conn = pymysql.connect(host='xx.xx.xx.xx', user= 'user', password= 'xxxxx', db='db', char

尝试使用PyMySQL版本0.8.0从Python(版本3.6.5)将数据帧输出到MySQL数据库表中。SQLAlchemy版本1.2.17,数据库服务器为8.0.1

到目前为止,相同的代码一直运行良好。如有任何关于如何解决的建议,我们将不胜感激

pymysql.install_as_MySQLdb()
conn = pymysql.connect(host='xx.xx.xx.xx', user= 'user', 
       password= 'xxxxx', db='db', charset='utf8mb4', 
       cursorclass=pymysql.cursors.SSCursor)

c = conn.cursor()
engine = create_engine('mysql://user:xxxx.xx.xx.xx/db')
database.to_sql('fact_data', con=engine)
database

错误:InternalError:(pymysql.err.InternalError)(1193,“未知系统变量‘transaction_isolation’”)

设法找到支持较新SQL版本的包版本组合:

pymysql-0.9.3
SQLAlchemy-1.3.4

设法找到支持较新SQL版本的包版本组合:

pymysql-0.9.3
SQLAlchemy-1.3.4

不确定是否相关,但在8.0.3版中删除了不推荐使用的变量名
tx\u isolation
。如果版本>=5.7.20,则SQLAlchemy mysql方言似乎使用了新名称。不确定是否相关,但在版本8.0.3中删除了不推荐使用的变量名
tx\u isolation
。如果版本>=5.7.20,SQLAlchemy mysql方言似乎使用了新名称。