当我通过SQLAlchemy(版本1.0.8)连接到MemSQL时,我收到一个错误
sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`Charset` = 'utf8' and `Collation` = 'utf8_bin'' at line 1") [SQL: "show collation where `Charset` = 'utf8' and `Collation` = 'utf8_bin'"]echo=True显示,在开始时,SQLAlchemy执行以下命令
show collation where `Charset` = 'utf8' and `Collation` = 'utf8_bin'当我手动运行上面的命令时,我得到了相同的错误,但当我删除字符集和排序规则周围的字符(`)时,查询运行得很好。这是MemSQL的问题吗?
顺便说一句,我使用默认的(MySQL)方式连接到MemSQL。
engine = create_engine('mysql://root@127.0.0.1:3306', echo=True)发布于 2015-09-12 03:48:48
这看起来像是一个合法的bug。这似乎是由SQLAlchemy中使用MySQL-Python库的代码中最近引入的更改/解决方法引起的。我们会努力把这个补丁到我们这边。
同时,OurSQL库运行良好:
>>> import sqlalchemy
>>> sqlalchemy.__version__
'1.0.8'
>>> sqlalchemy.create_engine("mysql+oursql://127.0.0.1").connect()
<sqlalchemy.engine.base.Connection object at 0x7f382ff19910>https://stackoverflow.com/questions/32523109
复制相似问题