当我通过 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'
当我手动运行上面的命令时,我得到了同样的错误,但是当我删除 Charset 和 Collation 周围的字符(`)时,查询运行正常。这是 MemSQL 问题吗?
顺便说一句,我使用默认(MySQL)方式连接到 MemSQL。
engine = create_engine('mysql://root@127.0.0.1:3306', echo=True)