How to store Emoji Character in MySQL Database

后端 未结 16 2028
迷失自我
迷失自我 2020-11-22 05:34

I am using Emoji character in my project. That characters are saved (??) into mysql database. I had used database Default collation in utf8mb4_general_ci. It sh

16条回答
  •  -上瘾入骨i
    2020-11-22 06:36

    1) Database: Change Database default collation as utf8mb4.

    2) Table: Change table collation as CHARACTER SET utf8mb4 COLLATE utf8mb4_bin.

    Query:

    ALTER TABLE Tablename CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
    

    3) Code:

    INSERT INTO tablename (column1, column2, column3, column4, column5, column6, column7)
    VALUES ('273', '3', 'Hdhdhdh

提交回复
热议问题