This article mainly introduces relevant information on the detailed explanation of the Chinese garbled problem in mysql database. Friends in need can refer to it.
When inserting a piece of data with Chinese characters into the MySQL database, the shape is insert into employee values(null,'Zhang San','female','1995-10-08','2015-11 -12','Sales',2000,'What a good employee! ')
; When garbled characters appear, you can use the statement show variables like 'character%'
; to view the relevant encoding set of the current database. .
As you can see from the above figure, MySQL uses character sets in six places, namely: client, connection, database, results, server, and system. Among them, related to the server: database, server, system (can never be modified, it is utf-8); related to the client: connection, client, results.
client |
is The character set used by the client. |
connection |
## is the character set setting for connecting to the database Type, if the program does not specify the character set type used to connect to the database, the server-side default character set setting will be used. |
##database
|
is a library in the database server The character set setting used, if not specified when building the database, will use the character set setting specified when the server is installed.
|
server |
is the default character set setting specified during server installation. |
system |
## is the character set used by the database system set up. |
Summary of solutions to Chinese garbled characters in mysql database
##Solutions to Chinese garbled characters in PHP connection to MySQL database_ PHP tutorialHow to solve Chinese garbled characters in mysql database. Modifying the character encoding in the configuration file has no effectThe above is the detailed content of Detailed explanation of the Chinese garbled problem in mysql database. For more information, please follow other related articles on the PHP Chinese website!