Chinese garbled characters in front-end learning Databases
Previous
It is very common to identify Chinese characters as garbled characters or question marks in the database due to encoding errors. This article describes the solutions in detail.
Configuration File
The first step to solve the problem of Chinese recognition is to modify the mysql configuration file my. ini.
Add under [client]
Default-character-set = utf8
Add under [mysqld]
Character-set-server = utf8
Then restart the service.
Database code
First, create a database
Use the following code to view the encoding type of the database:
Check whether the encoding type is utf8. If not, use the following code to change it to utf8.
Data Table Encoding
Create a data table
Run the following code to view the encoding type of the data table:
Check whether the encoding type is utf8. If not, use the following code to change it to utf8.
Chinese record
Add a record with Chinese characters below
Read records using SELECT statements
The Chinese characters are correctly displayed.
Welcome