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
Disclaimer: This password reset method can direct...
Understand this Perhaps you have seen this in oth...
The concept of mysql stored procedure: A set of S...
Preface Whether it is a stand-alone lock or a dis...
Serve: # chkconfig --list List all system service...
Table of contents summary Problem Description Ana...
1. Modify the firewall settings and open the corr...
Table of contents introduce Example Summarize int...
Table of contents Preface analyze Initial Renderi...
This article shares the specific code of JavaScri...
Table of contents Preface Why do we need to encap...
Table of contents <template> <ul class=&...
MySQL supports three types of comments: 1. From t...
Canvas has always been an indispensable tag eleme...
Source code preview: https://github.com/jdf2e/nut...