The question mark (?) is displayed when inserting data in the Mysql database (?) Mysql question mark
First, the mysql database I use is 5.7.12.
Problems:
1. Data insertion error. insertion failed. The following error occurs: Incorrect string value: '\ xCD \ xF5 \ xD5 \ xBC \ xBE \ xa9' for column 'sname' at row 1.
2. Chinese characters are inserted. Although the insertion is successful, the result is displayed as follows :??
Solution:
Add # character-set-server = utf8 to [mysqld] In the my. ini file
The content in the blue circle must be at the top of the blue circle, that is, the content in the blue circle must be at the bottom of [mysqld]; otherwise, the database cannot be logged on.
If the above solution still cannot be solved? Problems,
When connecting to the database, add? UseUnicode = true & characterEncoding = UTF-8. As follows:
"Jdbc: mysql: // localhost: 3306/sgmanagement? UseUnicode = true & characterEncoding = UTF-8 ";
Also on the Internet: Add # default-character-set = utf8 under [mysqld], but I didn't use it.
The above section describes how to solve the question mark (?) when inserting data in a Mysql database (?) To help you. If you want to learn more, please stay tuned to the help House website!