How to modify the MySQL character set

How to modify the MySQL character set

1. Check the character set of MySQL

show variables like '%char%'; 

2. Modify the MySQL configuration file

It's not the installation directory, it's the data directory. I opened it with sublime.

After entering, add configuration in three places.

First one:

[client]
  default-character-set=utf8

Second one:

[mysql]
 default-character-set=utf8

The third one:

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

Above:

save

3. Restart MySQL service

This computer -> Manage -> Services and Applications -> Services -> MySQL Service -> Restart

4. Log in to MySQL

Enter the command

show variables like '%char%'; 

Done

The above is the details of how to modify the MySQL character set. For more information about modifying the MySQL character set, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • MySQL character set viewing and modification tutorial
  • How to change MySQL character set utf8 to utf8mb4
  • How to change the default character set of MySQL to utf8 on MAC
  • MySQL startup error 1067 and invalid recovery after changing character set and restarting
  • How to change the character set encoding to UTF8 in MySQL 5.5/5.6 under Linux
  • How to modify the default character set encoding in MySQL
  • How to modify the default character set of MySQL to utf-8 through my.cnf and precautions
  • How to modify and view the character set of MySql tables, fields, and libraries
  • How to modify the database encoding (database character set) and the character encoding of the table in MySQL
  • Detailed analysis of two methods to modify the MySQL default character set
  • Sharing of MySQL character set and database engine modification methods
  • Practical tutorial on modifying MySQL character set

<<:  How does Zabbix monitor and obtain network device data through ssh?

>>:  JavaScript Array Detailed Summary

Recommend

How to implement Nginx reverse proxy for multiple servers

Nginx reverse proxy multiple servers, which means...

18 sets of exquisite Apple-style free icon materials to share

Apple Mug Icons and Extras HD StorageBox – add on...

Detailed explanation of Angular routing basics

Table of contents 1. Routing related objects 2. L...

Parse CSS to extract image theme color function (tips)

background It all started when a classmate in the...

Detailed explanation of CocosCreator message distribution mechanism

Overview This article begins to introduce content...

Detailed tutorial on installing nvidia driver + CUDA + cuDNN in Ubuntu 16.04

Preparation 1. Check whether the GPU supports CUD...

Detailed explanation of Vue custom instructions

Table of contents Vue custom directive Custom dir...

Install centos7 virtual machine on win10

1. Download VMware Workstation 64 version https:/...

MySQL uses find_in_set() function to implement where in() order sorting

This article introduces a tutorial about how to u...

Detailed introduction to CSS priority knowledge

Before talking about CSS priority, we need to und...

Secondary encapsulation of element el-table table (with table height adaptation)

Preface During my internship at the company, I us...

Implementation of vertical centering with unknown height in CSS

This article mainly introduces the implementation...

How to decompress multiple files using the unzip command in Linux

Solution to the problem that there is no unzip co...

JavaScript setTimeout and setTimeinterval use cases explained

Both methods can be used to execute a piece of ja...

The use and difference between vue3 watch and watchEffect

1.watch listener Introducing watch import { ref, ...