Home > Database > Mysql Tutorial > What are the MySQL string types?

What are the MySQL string types?

WBOY
Release: 2023-05-31 17:46:06
forward
2597 people have browsed it

 MySQL string type

In the MySQL database, there is no concept of string, only characters, so the database only uses single quotes.

Char(4): stores 4 characters, same as Chinese and English.

Varchar(L): To implement the variable length mechanism, additional space is needed to record the actual length of the data.

The theoretical length of L is 65535, but in fact it cannot be reached because some characters are multi-byte characters, so L cannot reach 65535

Utf8 1 character = 3 bytes

Gbk 1 character = 2 bytes

Note:

  1. The total length of all fields of a record (excluding big data) cannot exceed 65535

  2. The text series type stores the address in the table, occupying 10 bytes

The above is the detailed content of What are the MySQL string types?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template