Many friends will report the following error when inserting Chinese characters using MySQL: This is because we did not specify a character set. In the computer, characters are stored in a binary system. Similarly, Chinese characters also need to be stored in binary. Then we need to specify a table (representation rules: which Chinese characters correspond to which binary). Generally, utf8 is more commonly used. Of course, you can also specify utf8mb4, which can be used to represent more special symbols, such as emoticons. However, in our daily use, utf8 is sufficient. Let's take the utf8 character set as an example: First find the MySQL program in the start menu: Just right-click any of these two, then click More-Open File Location: Also right-click any of them, then click Properties, and find the path corresponding to my.ini in the target path: Then right-click my.ini and open it in Notepad Write utf8 after the equal sign under [mysql] Similarly, add utf8 to the right of the equal sign under [mysqld] (note that there should be no spaces on both sides) Pay special attention! ! ! After the modification, we can restart the computer, so that there will be no error when adding Chinese characters in the future (note here that before the modification, when inserting Chinese characters in the originally created database, an error will still be reported, and we should create a new database) This is the end of this article about the solution to Incorrect string value in Mysql. For more related Mysql Incorrect string value content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of anonymous slots and named slots in Vue
>>: About IE8 compatibility: Explanation of the X-UA-Compatible attribute
MySQL query not using index aggregation As we all...
1. Stop the mysqld.exe process first 2. Open cmd ...
1. The role of index Generally speaking, an index...
This article shares the specific code of uniapp t...
Rownum is a unique way of writing in Oracle. In O...
Using SSH terminal (such as putty, xshell) to con...
I just started learning about databases recently....
Baidu Cloud Disk: Link: https://pan.baidu.com/s/1...
Master-slave synchronization, also called master-...
The GtkTreeView component is an advanced componen...
View installation and uninstallation # View rpm -...
Because a certain function of my project requires...
Preface After a long time of reading various mate...
Table of contents 1. Introduction to Harbor 1. Ha...
MySQL 8.0: MVCC for Large Objects in InnoDB In th...