Home  >  Article  >  Database  >  What to do if mysql dos is garbled?

What to do if mysql dos is garbled?

藏色散人
藏色散人Original
2023-02-16 09:35:311375browse

Solution to mysql dos garbled code: 1. View all mysql encodings through "show variables like 'character%';", and then change the client encoding to gbk; 2. Open the my.ini configuration file, Modify the client encoding and then restart the service.

What to do if mysql dos is garbled?

The operating environment of this tutorial: Windows 10 system, MySQL version 5.7, Dell G3 computer.

mysql dos What to do if the code is garbled?

MySQL DOS operation data garbled solution

MySql database displays garbled characters in Chinese on the Dos interface as shown below:

What to do if mysql dos is garbled?

Reason: Because The problem with mysql client encoding is utf8, and the system cmd window encoding is gbk

Solution (temporary solution): Modify the mysql client encoding.

show variables like 'character%'; View all mysql encodings

What to do if mysql dos is garbled?

Encoding settings related to the client in the picture:

client connetionresult is related to the client

database serversystem is related to the server

Change the client encoding to gbk.

setcharacter_set_results=gbk; / set names gbk;

The above operations are only effective for the current window and will become invalid if the server is closed. If you want to make permanent changes, use the following method:

There is a my.ini file in the mysql installation directory

default-character-set=gbk client encoding setting -set-server=utf8 Server-side encoding setting

Note: After modifying the configuration file, restart the service.

Recommended learning: "

MySQL Video Tutorial

"

The above is the detailed content of What to do if mysql dos is garbled?. 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