First of all, I use the MySQL database is 5.7.12 version.
The problems that arise:
1. Insert data display error, insert unsuccessful, appear: incorrect string value: ' \XCD\XF5\XD5\XBC\XBE\XA9 ' for column ' sname ' at row 1
2. Insert Chinese, although inserted successfully, but show:??
Workaround:
Add #character to [mysqld] in the My.ini file-set-server=utf8
As shown in the picture, must be above the blue circle, that is, the content of the blue circle must be at the bottom of [mysqld], or simply cannot log in to the database.
If the above solution is still not solved? The problem,
When you connect to a database, add a useunicode=true&characterencoding=utf-8 this sentence. As shown below:
"Jdbc:mysql://localhost:3306/sgmanagement?useunicode=true&characterencoding=utf-8";
Online There are also said: under [mysqld] to join #default-character-set=utf8, but I do not use.
The above is a small series to introduce you to solve the MySQL database insert data to appear question mark (? Solution, hope to help everyone, if you want to know more content please pay attention to cloud Habitat community website!