Home > Database > Mysql Tutorial > body text

How to modify the character set of a field in mysql

WBOY
Release: 2022-05-12 17:06:27
Original
8387 people have browsed it

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

Second one:

[mysql] default-character-set=utf8
Copy after login

Third one:

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

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

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!

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