1

I was getting an error on inserting emoji through my android app in mysql db that :

java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8D\xF0\x9F...' for column 'question_text' at row 1

so i searched for it and found out that i had to Change the character set and collation properties of the databases, tables, and columns to use utf8mb4 instead of utf8. Well i thought of applying to just one column first so i executed the query:

ALTER TABLE question MODIFY question_text varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

But got the same error , than i thought of applying to the entire database so i executed the query:

ALTER DATABASE my_database CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

but still getting the same error . Can someone explain to me what i could be missing?

Syed Muhammad Oan
  • 687
  • 2
  • 15
  • 39

0 Answers0