Home  >  Article  >  Database  >  Solution to the problem that the mysql command line displays garbled characters

Solution to the problem that the mysql command line displays garbled characters

王林
王林Original
2020-09-29 14:48:462726browse

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 to the problem that the mysql command line displays garbled characters

##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

3. Enter in the mysql database cmd:

show variables like'%char%';

4. Change the encoding method of the original database:

set character_set_database=utf8;
set character_set_server=utf8;
set character_set_client=gb2312;
set character_set_connection=gb2312;

Related recommendations:

php training

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn