Home  >  Article  >  Database  >  How to change the encoding character set of mysql database

How to change the encoding character set of mysql database

王林
王林Original
2020-09-30 11:16:264065browse

How to change the encoding character set of the mysql database: 1. Open the my.ini configuration file; 2. Find the mysqld label and add the configuration [character-set-server=utf8] under the label; 3. Restart mysql service.

How to change the encoding character set of mysql database

Specific method:

(Recommended tutorial: mysql tutorial)

1. Enter mysql In the installation directory, find the my-default.ini or my.ini configuration file. You can modify my-default.ini to my.ini.

2. My my.ini only has one [mysqld] tag, and the others are in comment state. We do two things in my.ini

(1) In the [mysqld] tag Add: character-set-server=utf8

(2) Add a [client] tag, and add: default-character-set=utf8

3, Restart the mysql service;

4. Enter the dos interface, log in to the database, and enter the command: show variables like "%char%"; if the result shown in the figure below appears on the dos interface, it means that you have successfully modified the mysql encoding.

How to change the encoding character set of mysql database

Related recommendations: php training

The above is the detailed content of How to change the encoding character set of mysql database. 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