Home  >  Article  >  Database  >  How to modify the character set in mysql5.6

How to modify the character set in mysql5.6

WBOY
WBOYOriginal
2022-05-19 17:02:091797browse

Method: 1. Add "character_set_server=utf8" under mysqld in "my.cnf" and "default-character-set=utf8" under client; 2. Restart with "service mysql restart" .

How to modify the character set in mysql5.6

The operating environment of this tutorial: windows10 system, mysql5.6 version, Dell G3 computer.

How to modify the character set in mysql5.6

mysql 5.6 Modify the character set

View character set:

show variables like 'character%';
show variables like '%char%';

The default is used by both the client and the server latin1 is changed, so Chinese characters will be garbled.

How to modify the character set in mysql5.6

1. Modify the character set

Modify the /etc/my.cnf configuration file

[mysqld]
character_set_server=utf8
collation-server=utf8_general_ci
......
[client]  
#设置客户端字符集  
default-character-set=utf8

How to modify the character set in mysql5.6

2. Restart mysql

service mysql restart

Command settings will take effect

create database aa default-character-set=utf8;
--只有这个数据库是utf-8

Recommended learning: mysql video tutorial

The above is the detailed content of How to modify the character set in mysql5.6. 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