Home  >  Article  >  Database  >  How to modify utf8 in mysql

How to modify utf8 in mysql

藏色散人
藏色散人Original
2020-09-30 10:29:262783browse

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

Add

character-set-server=utf8

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

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

So change it to

character-set-server=utf8

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!

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