Home > Database > Mysql Tutorial > How to set and view MySQL database encoding

How to set and view MySQL database encoding

黄舟
Release: 2017-08-04 13:55:23
Original
2494 people have browsed it

Sometimes when we are developing, we need to use the mysql database. How to prevent Chinese garbled characters from appearing. The editor below will share how to set the encoding method of the mysql database

Mysql client to view and modify the encoding method

1. The first step is to open the mysql software, enter the password, and press the Enter key, as shown in the following figure:

How to set and view MySQL database encoding

2. In the second step, enter "use day14_customer;" on the command line, press Enter, enter the database, pay attention to the last semicolon, day14_customer is the name of the database, As shown in the figure below:

How to set and view MySQL database encoding

##3. In the third step, enter "show create database day14_customer;" to view the database Encoding method

How to set and view MySQL database encoding

##4. Step 4: Modify the database encoding information and enter

“alter database day14_customer default character set gbk;”
Copy after login

How to set and view MySQL database encodingmysql graphical interface to modify the viewing encoding method

1. The first step is to open the graphical interface of mysql. Here I installed SQLyog. As shown in the figure below:

How to set and view MySQL database encoding

2. In the second step, right-click the database and select "Change Database"

How to set and view MySQL database encoding

3. In the third step, we can modify the database encoding method, as shown in the figure below:

How to set and view MySQL database encoding

Test whether the database encoding contains Chinese garbled characters

1. The first step is to open the table in our database and click "Table Data" on the right

How to set and view MySQL database encoding

2. In the second step, we can see the specific data in the database. We can see that there are no Chinese garbled characters, as shown in the figure below:

How to set and view MySQL database encoding

##

The above is the detailed content of How to set and view MySQL database encoding. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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