Home > Database > Mysql Tutorial > How to set the character set to UTF8 in mysql

How to set the character set to UTF8 in mysql

王林
Release: 2020-07-06 11:04:09
Original
11494 people have browsed it

The method for setting the character set of mysql to UTF8 is: 1. Edit the my.ini file and modify the configuration [default-character-set=utf8]; 2. Restart the mysql service; 3. Log in to the mysql service again and view Character set settings.

How to set the character set to UTF8 in mysql

MySQL method to set all character sets to utf8:

(recommended learning: mysql tutorial)

1. Open the my.ini file in the MySQL installation directory and edit the following content:

[client]节点
default-character-set=utf8    (增加)
[mysql]节点
default-character-set=utf8    (修改)
[mysqld]节点
default-character-set=utf8    (修改)
character_set_server=utf8    (增加)
Copy after login

2. Restart the mysql service

net stop mysql
net start mysql
Copy after login

3. Log in to mysql again and execute the following command to view Current database character set configuration

show variables like '%character%';
Copy after login

The above is the detailed content of How to set the character set to 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