1. Show character setting
SHOW VARIABLES LIKE 'character%';

2. Setting character
SET character_set_database = utf8 ;

PS: However the first and second step is useless, that could be proved by login again! To solve the problem, it has to create the table with the SAME character encoding utf8.
3. Java insert chinese into table
There is problem when use JAVA insert chinese into MySQL table:

To solve the problem, it has to add '?useUnicode=true&characterEncoding=utf8' in the java URL:
![]()

本文介绍了如何解决MySQL中出现的中文乱码问题,包括设置字符集、创建表时指定字符编码以及在Java应用中插入中文时的解决方案。
3047

被折叠的 条评论
为什么被折叠?



