Home  >  Article  >  Database  >  mysql advanced (twenty-two) MySQL error Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...Chinese character input error

mysql advanced (twenty-two) MySQL error Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...Chinese character input error

黄舟
黄舟Original
2017-02-11 10:46:532100browse

MySQLErrorIncorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...' for column 'tout' at row 1 Chinese character input Error

During the experiment, the output parameters need to be written to the database. During the writing process, an error occurred when executing the lab_dynamic_order.upd_upd() statement. I didn’t understand at first what it was. Something went wrong. I tried to ask Du Niang for help. Some people on the Internet said it was because of the input of Chinese characters. Therefore, I copied the string containing Chinese characters to be written into mysql. When saving, Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...' for column 'tout appeared. ' at row 1 error message. After another search, the solution is as follows:

Change the corresponding column to utf8-utf8_general_ci.

The processed results are as follows


##Attachment-- -Data types supported by MySQL

MySQL provides 8 basic string types, namely: CHAR, VARCHAR, BINARY, VARBINARY, BLOB, TEXT, ENUM, SET and other string types.

Can store data ranging from as simple as a single character to huge blocks of text or binary strings.

String type Byte size Description and storage requirements

CHAR 0-255 bytes Fixed-length string

VARCHAR 0-255 bytes Variable-length string

TINYBLOB 0-255 bytes Binary string of no more than 255 characters

TINYTEXT 0-255 bytes Short text string

BLOB 0-65535 bytes Binary form Long text data

TEXT 0-65535 bytes Long text data

MEDIUMBLOB 0-16 777 215-byte medium-length text data in binary form

MEDIUMTEXT 0-16 777 215 bytes medium length text data

LOGNGBLOB 0-4 294 967 295 bytes very large text data in binary form

LONGTEXT 0-4 294 967 295 bytes very large text data

VARBINARY(M) Allows fixed-length byte strings with a length of 0-M bytes, the length of the value + 1 byte

BINARY(M) M Allows a length of 0-M words Fixed-length byte string of section

美文美图

The above is the content of mysql advanced (22) MySQL error: Incorrect string value: '\xE7\x81\xAB\xE7\x8B\x90...Chinese character input error. For more related content, please pay attention to the PHP Chinese website ( www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn