hyjal
hyjal

Reputation: 63

Using sqlalchemy and mysql-python, how to set charset=utf8mb4?

engine = create_engine('mysql+mysqldb://root:123456@localhost:3306/tianchi?charset=utf8mb4')

Traceback:

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2019, "Can't initialize character set utf8mb4 (path: C:\mysql\\share\charsets\)")

enter image description here

sqlalchemy:1.2.7 Mysql-python:1.2.5 Mysql:5.7.13

Upvotes: 1

Views: 1599

Answers (1)

hyjal
hyjal

Reputation: 63

I replace 'mysqldb' with 'pymysql' and it works.Thank everyone.

Upvotes: 2

Related Questions