Store Emoji in MySQL DB

If you want to store Emoji characters in a MySQL DB, you need to update the table encoding. You can do this by…

ALTER DATABASE <DATABASE_NAME> CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ;
ALTER TABLE <table_name> CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- ALTER TABLE <table_name> MODIFY <field_name> TEXT CHARSET utf8mb4;

Source

Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

Leave a Reply

Your email address will not be published. Required fields are marked *