Home >Database >Mysql Tutorial >What should I do if the Chinese garbled data inserted into the table data in mysql should be solved?
Solution to Chinese garbled Chinese characters when inserting table data into mysql: 1. Check whether the default encoding method of the local mysql installation file directory is utf8; 2. Start the mysql service and enter the relevant commands to encode the character set of the default database table. Change to utf8; 3. Restart the service.
The operating environment of this tutorial: Windows 7 system, mysql version 8.0.22, DELL G3 computer.
Solution to Chinese garbled table data inserted into mysql:
1. Check the my.ini configuration file in the local mysql installation file directory, the default settings of the server and client Is the encoding method utf8
[mysqld] # 服务端使用的字符集默认为UTF8 character-set-server=utf8 [client] # 设置mysql客户端连接服务端时默认使用的端口 default-character-set=utf8
2. After the previous step is correct, open the command line and enter: net start mysql to start the mysql service; after
displays "The service has been started successfully", enter the command "mysql", use the database;
mysql> net stop mysql; mysql> net start mysql;
Related free learning recommendations: mysql video tutorial
The above is the detailed content of What should I do if the Chinese garbled data inserted into the table data in mysql should be solved?. For more information, please follow other related articles on the PHP Chinese website!