The following error occurs when entering Chinese in MySQL: ERROR 1366: 1366: Incorrect string value: '\xE6\xB0\xB4\xE7\x94\xB5...' for column 'introduce' at row 1 This is because of mysql encoding problem Open mysql mysql -u root -p After entering the password, enter the following line of code to display the encoding currently used by MySQL: SHOW VARIABLES LIKE 'character%';
As can be seen from the figure, the character sets of the database and server use the latin1 encoding method. The latin1 encoding does not support Chinese, so errors will occur when storing Chinese. Solution: Modify /etc/mysql/my.cnf (this is the default installation path of mysql) [client] default-character-set=utf8 [mysqld] character-set-server=utf8 [mysql] default-character-set=utf8 Save and exit. Restart mysql service service mysql restart Now delete the problematic table in MySQL and rebuild it to solve the problem. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to obtain and use time in Linux system
>>: 7 interview questions about JS this, how many can you answer correctly
Table of contents 1. First look at COUNT 2. The d...
Nginx supports three ways to configure virtual ho...
1. Installation of MYSQL 1. Open the downloaded M...
This article example shares the specific code of ...
Table of contents 1. Usage of DATETIME and TIMEST...
The most common mistake made by many website desi...
This article example shares the specific code of ...
MySQL paging analysis principle and efficiency im...
Table of contents 0x0 Introduction 0x1 Installati...
Basic concepts of consul Server mode and client m...
Table of contents 1 Problems encountered in trans...
Causes and consequences 1. When using the ansible...
Table of contents 1. Basics of audio playback in ...
1: Differences in speed and loading methods The di...
Preface The database deadlocks I encountered befo...