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. Introduction 1.1 Babel Trans...
Since there is a button in my company's produ...
<br />I am very happy to participate in this...
Table of contents 1. World Map 1. Install openlay...
Table of contents 1. Nginx implements load balanc...
As the title says, otherwise when the page is revi...
IE10 provides a quick clear button (X icon) and a ...
background As the number of application systems c...
1. Add fields: alter table table name ADD field n...
Route Jump this.$router.push('/course'); ...
Today I will take you through the history of ext4...
This article shares the specific code of JavaScri...
Introduction Based on docker container and docker...
Since this is my first post, if there are any mis...
Table of contents 1. What is JSON 1.1 Array liter...