Home  >  Article  >  Database  >  How to set the character set to UTF8 in mysql

How to set the character set to UTF8 in mysql

王林
王林Original
2020-07-06 11:04:0911303browse

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    (增加)

2. Restart the mysql service

net stop mysql
net start mysql

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

show variables like '%character%';

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!

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