Solution to the problem that the mysql command line displays garbled characters: 1. Open the my.ini configuration file; 2. Modify the configuration [default-character-set=utf8]; 3. Change the encoding method of the database, such as [set character_set_connection =gb2312].
##Solution: (Recommended tutorial:
mysql tutorial)
1. Find the directory where mysql is installed and find the my.ini file; 2. Use Notepad to open the my.ini file,modify it according to the following configuration
# MySQL client library initialization. [client] port=3306 [mysql] default-character-set=utf8
show variables like'%char%';
set character_set_database=utf8; set character_set_server=utf8; set character_set_client=gb2312; set character_set_connection=gb2312;
The above is the detailed content of Solution to the problem that the mysql command line displays garbled characters. For more information, please follow other related articles on the PHP Chinese website!