1. Solve the problem of java program reading garbled mysql database
1. Open the /etc/my.cnf file, find the following content, and then add the red content:
# The following options will be passed to all MySQL clients [client]
# password = your_password
port = 3306
socket = /tmp/mysql.sock
default-character-set=utf8 # Statements that we need to add manually
2. Change the default encoding of the system to utf-8, edit the file /etc/sysconfig/i18n, no matter whether you install the Chinese version or the English version, delete the original configuration, copy the following, save, and restart mysql Service is just fine.
LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"