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
Win10 system locally installed MySQL8.0.20, perso...
This article shares with you how to use the Vue c...
Table of contents Arithmetic operators Abnormal s...
We all know that the commonly used positioning me...
Using abbreviations can help reduce the size of yo...
When inserting a set of data into the MySQL datab...
Quick Start 1. Find the nginx image on Docker Hub...
Ellipses appear when multi-line text overflows Th...
Table of contents 1. Single database backup 2. Co...
Table of contents 1 Background 2 Create a contain...
Preface Relational databases are more likely to b...
Question: How to achieve a rounded rectangle usin...
String extraction without delimiters Question Req...
Table of contents 1. context 1. Usage scenarios 2...
Docker daemon socket The Docker daemon can listen...