Home  >  Article  >  Database  >  How to modify the character set of a field in mysql

How to modify the character set of a field in mysql

WBOY
WBOYOriginal
2022-05-12 17:06:278388browse

Method: 1. Open the "my.ini" file and add "default-character-set=utf8" under client; 2. Add "default-character-set=utf8" under mysql; 3. Just modify the contents of mysqld and then restart it.

How to modify the character set of a field in mysql

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

How to modify the character set of a field in mysql

Modify the MySQL configuration file

Find the my.ini file

After entering it, add configurations in three places.

First one:

[client] default-character-set=utf8

Second one:

[mysql] default-character-set=utf8

Third one:

[mysqld] character-set-client-handshake = FALSE character-set-server = utf8 collation-server = utf8_unicode_ci init_connect='SET NAMES utf8'

How to modify the character set of a field in mysql

How to modify the character set of a field in mysql

Restart MySQL service

This computer——>Management——>Services and Applications——>Service——>mysql service——>Restart

Enter the command

show variables like '%char%';

to view the mysql character set

How to modify the character set of a field in mysql

## Recommended learning:

mysql video tutorial

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