Use utf8mb4 charset for the DB connection to MySQL
This commit is contained in:
parent
351d98c523
commit
3c3a03a5ae
1 changed files with 1 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ class MySQLSession(Session):
|
||||||
"""docstring for MySQLSession"""
|
"""docstring for MySQLSession"""
|
||||||
def __init__(self, settings):
|
def __init__(self, settings):
|
||||||
self.engine = create_engine(
|
self.engine = create_engine(
|
||||||
'mysql+pymysql://{user}:{passwd}@{host}:{port}/{db}'.format(**settings))
|
'mysql+pymysql://{user}:{passwd}@{host}:{port}/{db}?charset=utf8mb4'.format(**settings))
|
||||||
super(MySQLSession, self).__init__(bind=self.engine)
|
super(MySQLSession, self).__init__(bind=self.engine)
|
||||||
|
|
||||||
def create_db(self):
|
def create_db(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue