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

In-depth explanation of the impact of NULL on indexes in MySQL

Preface I have read many blogs and heard many peo...

Detailed explanation of the syntax and process of executing MySQL transactions

Abstract: MySQL provides a variety of storage eng...

VMware Tools installation and configuration tutorial for Ubuntu

Some time ago, the blogger installed the Ubuntu s...

Vue uses the video tag to implement video playback

This article shares the specific code of Vue usin...

How to enable or disable SSH for a specific user or user group in Linux

Due to your company standards, you may only allow...

The perfect solution for highlighting keywords in HTML

I recently encountered a feature while working on...

Detailed explanation of the execution process of mysql update statement

There was an article about the execution process ...

How to elegantly implement the mobile login and registration module in vue3

Table of contents Preface Input box component lay...

Example of how to configure the MySQL database timeout setting

Table of contents Preface 1. JDBC timeout setting...

How to install git on linux

1. Introduction Git is a free, open source distri...

Simple method to install mysql under linux

When searching online for methods to install MySQ...

Detailed Analysis of the Differences between break and last in Nginx

Let's talk about the difference first last, t...