带MemSQL的SQLAlchemy语法错误

2024-04-28 23:40:33 发布

您现在位置:Python中文网/ 问答频道 /正文

当我通过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'"]

alchemy在下面的命令中显示了执行以下命令的alchemy=True

^{pr2}$

当我手动运行上面的命令时,我得到了相同的错误,但是当我删除字符集和排序规则的字符(`)时,查询运行良好。这是MemSQL问题吗?在

顺便说一句,我使用默认(MySQL)方式连接到MemSQL。在

engine = create_engine('mysql://root@127.0.0.1:3306', echo=True)

Tags: andtheto命令sqlyour错误mysql
1条回答
网友
1楼 · 发布于 2024-04-28 23:40:33

看起来像个合法的虫子。这似乎是由SQLAlchemy在使用MySQL Python库的代码中引入的最近的更改/解决方法引起的。我们会努力把这个修补好。在

同时,我们的SQL库运行良好:

  >>> import sqlalchemy
  >>> sqlalchemy.__version__
  '1.0.8'
  >>> sqlalchemy.create_engine("mysql+oursql://127.0.0.1").connect()
  <sqlalchemy.engine.base.Connection object at 0x7f382ff19910>

相关问题 更多 >