In Django project, when you create database and tables through model.py, the default encoding is utf-8, which you can see clearly in Navicat. But this encoding restrict the size of single unicode character to 3 Bytes. When you need to store larger size character like emogi(4 Bytes), MySQL will reporte an error.
django.db.utils.OperationalError: (1366, "Incorrect string value:...
So to avoid this problem, change the encoding to utf8mb4 , which has to new features:
- Requires a maximum of four bytes per multibyte character
- Supports BMP and supplementary characters.
The change command is following
ALTER TABLE TABLENAME CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin