Solution to the problem that MySQL in Windows system cannot input and display Chinese

Solution to the problem that MySQL in Windows system cannot input and display Chinese

Step 1: Use Notepad to open the "my.ini" file in the MySQL installation directory.

# MySQL client library initialization.
[client]
port=3306
[mysql]
default-character-set=utf8

Check if default-character-set is utf8, if not, just change it to utf8! (Previous versions may not have this sentence, so just add it!)

Step 2: Enter in the MySQL database cmd: show variables like'%char% ';

This is what it looks like after successful setup.

Step 3:

set character_set_database=utf8;
set character_set_server=utf8;
set character_set_client=gbk;
set character_set_connection=gbk;

This is the configuration to insert Chinese characters. You must enter these commands in cmd to run mysql.

Step 4:

set character_set_results=gbk

This is the configuration to display Chinese. Done

Next, I will share a graphic operation method

#Solve the problem that mysql cannot input Chinese characters

Modify the mysql character set and modify the configuration file my.ini
character_set_server = utf8
Centered image:

insert image description here 2.

We have already established the database, and now we also need to change the database character set in Navicat for MySQL. Right-click the database and select Database Properties, as shown in the figure. After entering, change the character set to utf8

insert image description here 3. You also need to right-click each table and select the involved table;

Then in "Options", modify the character set of the table.

insert image description here 4.

Enter the design table, click on a field, and find that the data type is still Latin1. OK, just change it one by one.

insert image description here
5. It’s done perfectly, you can try it now.

Summarize

The above is the solution to the problem that MySQL on the window system cannot input or display Chinese. I hope it will be helpful to everyone. If you have any questions, please leave me a message and I will reply to you in time!

You may also be interested in:
  • How to solve the problem of garbled Chinese characters displayed in the MySQL client output window
  • mysql odbc character set setting (Chinese characters are displayed in garbled characters)
  • MySQL cannot display Chinese and its solution

<<:  Nginx merges request connections and speeds up website access examples

>>:  Writing Snake Game with Native JS

Recommend

Basic knowledge of MySQL learning notes

View Database show databases; Create a database c...

iframe adaptive size implementation code

Page domain relationship: The main page a.html bel...

Ubuntu installs multiple versions of CUDA and switches at any time

I will not introduce what CUDA is, but will direc...

Introduction to Common XHTML Tags

<br />For some time, I found that many peopl...

Monitor changes in MySQL table content and enable MySQL binlog

Preface binlog is a binary log file, which record...

Detailed explanation of important cascading concepts in CSS

Recently, I encountered a problem in the process ...

How to use JS to parse the excel content in the clipboard

Table of contents Preface 1. Paste Events and Cli...

Vue custom v-has instruction to implement button permission judgment

Application Scenario Taking the background manage...

Problems encountered when uploading images using axios in Vue

Table of contents What is FormData? A practical e...

react-diagram serialization Json interpretation case analysis

The goal of this document is to explain the Json ...

Detailed steps to install python3.7 on CentOS6.5

1. Download Python 3 wget https://www.python.org/...

Difference between querySelector and getElementById methods in JS

Table of contents 1. Overview 1.1 Usage of queryS...

Embed codes for several older players

The players we see on the web pages are nothing m...

Using js to realize dynamic background

This article example shares the specific code of ...