2

I have mySql server on ubuntu 16. When I tried save txt in Cyrillic I have error

java.sql.SQLException: Incorrect string value: '\xD0\xBA\xD1\x83\xD0\xBF...' for column 'description' at row 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963) ~[mysql-connector-java-5.1.39.jar:5.1.39]
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966) ~[mysql-connector-java-5.1.39.jar:5.1.39]

When I run mysql> show variables like 'char%' I get this

    mysql> show variables like 'char%';
    +--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

I have this config [mysqld]:

skip-character-set-client-handshake
character-set-server = utf8
init-connect='SET NAMES utf8'
collation-server=utf8_general_ci
user5620472
  • 2,722
  • 8
  • 44
  • 97
  • i fix it. I recreate DB with utf8mb4 encoding and it work fine! Do I need to remove the issue, or leave, if I see that it is interesting, and describe the response fully later? – user5620472 Oct 06 '16 at 07:11
  • `utf8mb4` is _not_ needed for Cyrillic; `utf8` suffices. You apparently fixed something else when you got it to work. – Rick James Oct 07 '16 at 02:28

0 Answers0