3719: 'utf8' is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 - When using MySQL sakila and world DB examples

2,930 views
Skip to first unread message

Ram Munjuluri

unread,
Jul 12, 2018, 1:27:24 PM7/12/18
to Django users
Hello all,

I posted this question with a different subject line and thought  I would re-post here with the error.

I am using

MySQL 8.0
Python 3.6.5
Django 2.0.7

When I run 

> python manage.py inspectdb --database world city

I get the following error message. Has someone come across this error before? I have dropped the schema and recreated it, but to no effect.


# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
#   * Rearrange models' order
#   * Make sure each model has one field with primary_key=True
#   * Make sure each ForeignKey has `on_delete` set to the desired behavior.
#   * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models
# Unable to inspect table 'city'
# The error was: (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)

Any suggestion here please? I seem to be stuck here.

Appreciate it.

kind regards
-Ram

Melvyn Sopacua

unread,
Jul 12, 2018, 5:43:23 PM7/12/18
to django...@googlegroups.com
On donderdag 12 juli 2018 19:27:23 CEST Ram Munjuluri wrote:

> from django.db import models
> # Unable to inspect table 'city'
> *# The error was: (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)*
>
> Any suggestion here please? I seem to be stuck here.

Downgrade to MySQL 5.x or patch PyMySQL. More info:
https://github.com/PyMySQL/PyMySQL/issues/690

--
Melvyn Sopacua

Ram Munjuluri

unread,
Jul 12, 2018, 11:48:39 PM7/12/18
to Django users
thanks Melvyn. let me try to downgrade to MySQL 5.7.7 first.

Ram Munjuluri

unread,
Jul 13, 2018, 12:19:24 AM7/13/18
to Django users
Downgrading to 5.7.7 and installing "mysql-connector-python 8.0.11" through pip fixed the issue.
Is this because the mysql-connector-python from MySQL/Oracle does not work with their own MySQL 8.0.11 version?


thanks
-Ram

Ciaran O'Sullivan

unread,
Aug 15, 2018, 8:12:41 PM8/15/18
to Django users
I raised this with Django:

It is a MySQL 8 feature that inspectdb seems unable to tolerate.The information_schema is still utf8 not utf8mb3 or utf8mb4
Using MySQL 8 for a college project, have My Schema nailed and was going to use Django to display information. Frustrated is the word.

Tim Graham

unread,
Aug 16, 2018, 9:59:54 AM8/16/18
to Django users
It looks like some code is promoting MySQL's warnings to exceptions. django.db.backends.mysql had that behavior before Django 1.8:

For anyone reporting this, are you using django.db.backends.mysql or some other database engine? If the latter, that backend may be at fault.

Ciaran O'Sullivan

unread,
Aug 16, 2018, 4:38:42 PM8/16/18
to Django users
I added a comment with a workaround to the Django Ticket. https://code.djangoproject.com/ticket/29678

Included is the settings.py and the changes made. 

Reply all
Reply to author
Forward
0 new messages