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

React internationalization react-i18next detailed explanation

Introduction react-i18next is a powerful internat...

Vue implements a simple shopping cart example

This article shares the specific code of Vue to i...

Introduction to Jenkins and how to deploy Jenkins with Docker

1. Related concepts 1.1 Jenkins Concepts: Jenkins...

Detailed explanation of Javascript basics

Table of contents variable Data Types Extension P...

How to view and set the mysql time zone

1. Check the database time zone show variables li...

CocosCreator Typescript makes Tetris game

Table of contents 1. Introduction 2. Several key ...

Sample code for implementing follow ads with JavaScript

Floating ads are a very common form of advertisin...

Two methods of implementing automatic paging in Vue page printing

This article example shares the specific code of ...

Solution to the ineffective margin of div nested in HTML

Here's a solution to the problem where margin...

Simple use of Vue vee-validate plug-in

Table of contents 1. Installation 2. Import 3. De...

Vuex modularization and namespaced example demonstration

1. Purpose: Make the code easier to maintain and ...