MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors
N.M.P.L. Company www.NearMePayday.Loan || 3-month (90 days)
Powered by MySQL
 
Home / Database Structure / Data Types / Question No: 109

What are string data types in MySQL 5?

I need string data types description. Any help?

Answer No: 109

The string data types include binary and non-binary string data.

The CHAR, VARCHAR, and TEXT data types store non-binary strings (that is, strings of characters that have a character set and collation).

The BINARY, VARBINARY, and BLOB data types are the binary string equivalents of the non-binary CHAR, VARCHAR, and TEXT data types. That is, they store strings that consist of bytes rather than characters, and they have no character set or collation.

The following table summarizes the non-binary string data types. For the storage requirement values, M represents the maximum length of a column. L represents the actual length of a given value, which may be 0 to M.

Type Storage Required Maximum Length
CHAR(M) M characters 255 characters
VARCHAR(M) L characters plus 1 or 2 bytes 65,535 characters (subject to limitations)
TINYTEXT L characters + 1 byte 255 characters
TEXT L characters + 2 bytes 65,535 characters
MEDIUMTEXT L characters + 3 bytes 16,777,215 characters
LONGTEXT L characters + 4 bytes 4,294,967,295 characters

The following table summarizes the binary string data types. For the storage requirement values, M represents the maximum length of a column. L represents the actual length of a given value, which may be 0 to M.

Type Storage Required Maximum Length
BINARY(M) M bytes 255 bytes
VARBINARY(M) L bytes plus 1 or 2 bytes 65,535 bytes (subject to limitations)
TINYBLOB L + 1 bytes 255 bytes
BLOB L + 2 bytes 65,535 bytes
MEDIUMBLOB L + 3 bytes 16,777,215 bytes
LONGBLOB L + 4 bytes 4,294,967,295 bytes

Related MySQL FAQs to the Above FAQ

What-is-BIT-Data-Type-in-MySQL What is BIT Data Type in MySQL?

What-are-numeric-data-types-in-MySQL What are numeric data types in MySQL?

What-are-integer-data-types-in-MySQL What are integer data types in MySQL?

What-are-float-data-types-in-MySQL What are float data types in MySQL?

What-is-fixed-point-and-decimal-data-type-in-MySQL What is fixed point and decimal data type in MySQL?

What-is-MySQL-default-character-set What is MySQL default character set?

What-is-difference-between-binary-and-non-binary-string-data-types What is difference between binary and non-binary string data types?

What-are-ENUM-and-SET-Data-Types-in-MySQL What are ENUM and SET Data Types in MySQL?

What-is-difference-between-CHAR-AND-VARCHAR-data-types What is difference between CHAR AND VARCHAR data types?

How-to-reformat-date-values-in-MySQL How to reformat date values in MySQL?

How-to-reformat-Time-values-in-MySQL How to reformat Time values in MySQL?

What-are-Temporal-Data-Types-in-MySQL What are Temporal Data Types in MySQL?

What-are-DATE-TIME-DATETIME-and-YEAR-Data-Types-in-MySQL What are DATE, TIME, DATETIME and YEAR Data Types in MySQL?

What-is-TIMESTAMP-Data-Type-in-MySQL What is TIMESTAMP Data Type in MySQL?

About FAQs: Recently Added FAQs

About MySQL FAQs: Site Map | Bookmark Us | Recommend this Site to Your Friend | Contact Us

Useful Links: Wikipedia.org | Oracle.com | w3schools.com | www.php.net | Github.com

© 2021  www.mysqlfaqs.net
All rights reserved.