Django + MySQL - Unknown encoding: utf8mb4

前端 未结 3 1318
[愿得一人]
[愿得一人] 2021-02-08 23:08

MySQL 5.5.35 Django 1.6.1

In order to support emoticons in the DB, I have configured in my django settings:

\'OPTIONS\': {\'charset\': \'utf8mb4\'}
         


        
3条回答
  •  春和景丽
    2021-02-08 23:49

    Fast and easy way.

    connection = mysql.connector.connect(user='username',
                                       password='mypass',
                                        host='localhost',
                                         database='mydb',
                                           use_pure=True,
                                          charset='utf8'
                                          )
    

提交回复
热议问题