Home > Database > Mysql Tutorial > body text

How to modify the character set in mysql5.6

WBOY
Release: 2022-05-19 17:02:34
Original
1802 people have browsed it

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%';
Copy after login

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
Copy after login

How to modify the character set in mysql5.6

2. Restart mysql

service mysql restart
Copy after login

Command settings will take effect

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

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!

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