How to Insert the Special Characters in MySQL

If we try to save unusual things in our database we experiences problems with character set. For example when we try to register the emojis if you didn't set the character set correctly we can not save in our database. To save special characters such as emoji we need to indicate the character set as utf8mb4_general_ci for our database and tables.

Firstly if you are going to make any changes in database first run this query below.

ALTER DATABASE dbName CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;

Then change your tables in same way

ALTER TABLE tableName CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Now you may save your special characters. If still there is a problem make sure that you did  related part correctly in my this article.


There are no comments, make the firs comment