When I try to execute a query via flyway from my java application, the data in my database are saved in incorrect form. Example is the query below:
INSERT INTO `table_lang` (`id`, `name`) VALUES ('14', 'русский');
The name in table_lang after execution for id= 14 is
p??????
So I thought that the problem was due to the input file, and I tried to insert in the query my name converted with various charsets
- русский
- \u0440\u0443\u0441\u0441\u043a\u0438\u0439 as UTF-16
- \xd1\x80\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9 as UTF-8
and I tried to change the charset and the collate of my table of interest respectively
CHARACTER SET = utf16 , COLLATE = utf16_general_ci ;
CHARACTER SET = utf8 , COLLATE = utf8_general_ci ;
CHARACTER SET = utf16 , COLLATE = utf16_general_ci ;
CHARACTER SET = utf8mb4 , COLLATE = utf8mb4_general_ci ;
None of these approaches work. Do you know how it can be solved?