You should alter table charset to use utfmb4 collate utf8mb4_unicode_ci if you face query error when the query string containing emoticon like ๐Ÿ“บ or ๐Ÿ”Š. Its error message will be something like SyntaxError: Non-UTF-8 code starting with '\xed' ...

The basic utf-8 format in the MySQL is 3-bytes data type, so the special characters like ๐Ÿ“บ or ๐Ÿ”Š are not supported. The solution is to convert the table type in the 4 bytes data type as following:


ALTER DATABASE [database_name] CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
ALTER TABLE [table_name] CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;


When you create your table it should be like

create table test(
    id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
    title text
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;