Home > Database > Mysql Tutorial > How to modify utf8 in mysql

How to modify utf8 in mysql

藏色散人
Release: 2020-09-30 10:29:26
Original
2832 people have browsed it

Mysql method to modify utf8: first check the mysql character set through "show variables like 'character_set_%';"; then find the my.ini file in the mysql installation directory and modify it; finally restart mysql.

How to modify utf8 in mysql

Recommendation: "mysql tutorial"

mysql 5.7 version modified encoding to utf-8

I just started learning mysql. I downloaded the latest version 5..7.14 from the official website. When I used cmd to input Chinese, I got an error, so I started to modify the default encoding of mysql (under windows)

First pass show variables like 'character_set_%'; View the mysql character set information

The default encoding is latin1

Then close the database

Find the my.ini file in the mysql installation directory

Add # to it

##

[client]
default-character-set=utf8
Copy after login

Add

character-set-server=utf8
Copy after login
Copy after login

under [mysqld]

Restart mysql

The mysql database can be The default encoding is changed to utf-8

Many resources on the Internet are added under [mysqld]

default-character-set=utf8
Copy after login

If this is changed, the 5.7 version of mysql cannot be opened

So change it to

character-set-server=utf8
Copy after login
Copy after login

The above is the detailed content of How to modify utf8 in mysql. 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