Home > database >  Mysql character set utf8mb4 setting is invalid
Mysql character set utf8mb4 setting is invalid

Time:09-27

Background: due to solve the Java. SQL. SQLException: Incorrect string value: '\ xF0 \ x9F \ x92 \ x94' for column 'name' at row 1 is unusual, so to change the mysql character set, utf8mb4 instead,

Modify the character set refer to the article as follows (see no effect after modification) :

https://www.jb51.net/article/144079.htm

https://blog.csdn.net/u014034329/article/details/80969246

Mysql information:

Version: 5.7.22 -installation version

Path: D: \ Work_Program_Files \ mysql

My. Ini file information:

 
[client]Default - character - set=utf8mb4
[mysql]
Default - character - set=utf8mb4
='set names init_connect utf8mb4'
[mysqld]
Character - set - the client - handshake=FALSE
Character - set - server=utf8mb4
Collation - server=utf8mb4_unicode_ci


Mysql has been configured to Windows service and start the success, but through navicatformysql login mysql, through the show VARIABLES like 'char %'; Command to check out the results as follows:

Variable character_set_client character_set_connection, character_set_results character_set_system didn't instead utf8mb4



Question: how to modify the mysql character set, ensure character_set_client, character_set_connection, character_set_results, character set for utf8mb4 character_set_system variables

CodePudding user response:

Client perform set names utf8mb4, through client connection is to specify the character set, depending on your connection ways you can search on the Internet a "xx to connect mysql is the specified character set"

CodePudding user response:

reference 1st floor ZJCXC response:
client perform set names utf8mb4, through client connection is to specify the character set, you can according to your connection method on the network search for a "xx to connect mysql is the specified character set"

Thank you for your answer!
Excuse me, do you mean connect to the database when the specified character set? For example, when using a JDBC connection mysql, the url specified in the character set?
  • Related