Home > Database > Mysql Tutorial > body text

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

王林
Release: 2020-09-29 14:48:46
Original
2657 people have browsed it

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
Copy after login

3. Enter in the mysql database cmd:

show variables like'%char%';
Copy after login

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;
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!