当前位置:网站首页>The solution of MySQL inserting Chinese errors
The solution of MySQL inserting Chinese errors
2022-07-21 05:14:00 【504 Gateway Time-out】
@ Catalog
Problem introduction
Get to know the database , When trying to insert Chinese data , You may encounter some error messages ;
On the premise that the database and table are created correctly , We try to insert Chinese “ Zhang San ”, Errors found ;
What's the reason ?
Background introduction
In the database , Expressing Chinese , Clear character encoding is required ( Character set );
MYSQL The default character set is “ Latin ”, This character set does not support Chinese ;
terms of settlement
Here is a way to do it once and for all : modify mysql Configuration file for
- Determine the character set of the current database
This operation is to prevent the secondary modification of the database that has undergone configuration modification
Use command show variables like ‘character%’;
The above picture shows , That is, you need to modify its configuration file
- Find the configuration file (my.ini)
The specific search steps are as follows :
- Start menu bar find MYSQL Shortcut to — Right click — more — Open file location
- In the location of the file — Right click — attribute — The goal is
- Copy the contents of the target completely to Notepad , You can see that my.ini Path to file
- Copy the path to the file, and the file manager will find my.ini file
5. Modify the configuration file
Before modifying the configuration file , To back it up ( Copy — Paste );
Edit profile — Notepad open — Find the following 2 The plate part of the picture — Modify as shown in the figure
- restart MYSQL The server ( Must be carried out , Otherwise, it will not take effect )
Found in service MYSQL— Right click — Restart , that will do
in addition , Modify the configuration file , It will not affect the database created before modification , So you want to use a new configuration file for the database , The database and table must be rebuilt ;
Problem verification
After modifying the configuration file , Restart the server , Then build the database and table again ;
Try inserting Chinese
You can see , Chinese inserted successfully .
over!
边栏推荐
猜你喜欢
Introduction to wafer and application of IGBT wafer
AutoJs學習-投幣小遊戲
redis锁超卖解决问题
keras MNIST手寫數字數據集數字識別
Keras MNIST Handwritten Digital Data Set Digital Recognition
Apprentissage autojs - jeux de pièces
QQ Three Party login - pre environment and interaction
MySQL的增删查改【进阶】
10 聊聊ThreadLocal
DeFi 2.0的LaaS协议,重振DeFi赛道发展的关键
随机推荐
Comparison table of English abbreviations of network security terms
Summary of shangyitong project
[QNX hypervisor 2.2 user manual] directory
Force buckle 741 Cherry picking
01 课程简介&爬虫概述
One question per day · 731 My schedule | · array
01 Course Introduction & Reptile overview
Autojs learning - realize transparent status bar
What does polardb for Postgres SQL mainly say?
创建K26 SOM最小系统
Thirteen grammar learning of reflect
Arduino IDE for Raspberry Pi Pico开发固件本地化安装教程
每日三题 7.15
Redis实现秒杀系统
03 BeautifulSoup解析库
关于晶圆介绍以及IGBT晶圆的应用
【学习笔记】数论思维题
【LeetCode】206. Reverse linked list
How to understand software testing with the 28 principle? See the following
Jmeter 接口必加元素