S
S
Serj B2018-08-12 23:10:33
MySQL
Serj B, 2018-08-12 23:10:33

Django & Mysql 8.0 UTF8MB4 how to make it work?

I installed Django 2.1 and MySQL 8 for communication using mysql-connector-python 8.0.12
the first migrate command created all the base tables in the database + all the tables described in models.
There was a need to add several tables. makemigrations generated migrations, but running migrate throws an error:
django.db.utils.DatabaseError: (3719, "3719: 'utf8' is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.", None)
DB connection setup:

DATABASES = {
    'default': {
        'ENGINE': 'mysql.connector.django',
        'NAME': 'xxxx',
        'USER': 'xxxx',
        'PASSWORD': 'xxxx',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'OPTIONS': {
            'charset': 'utf8mb4',
        }
    }
}

Actually, how to make everything work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2018-08-13
@netpastor

https://stackoverflow.com/questions/49316327/how-t...
Will not save the father of Russian democracy?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question