I am using MySql along with Django. I am trying to save an object containing an emoji. I have changed the charset for the table using the following commands
ALTER DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE mydb.mytable CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
and when I use the command
SHOW FULL COLUMNS FROM table_name;
for seeing the columns I get the following output -
Field: unit_text
Type: longtext
Collation: utf8mb4_unicode_ci
Null: YES
Key:
Default: NULL
Extra:
Privileges: select,insert,update,references
Comment:
Here coalition is utf8mb4_unicode_ci but still, when I try to save the object I get this error -
OperationalError "Incorrect string value"
Please let me know what I should do