
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Best data type for storing large strings in MySQL?
You can use text data type to store large strings. Following is the syntax −
CREATE TABLE yourTableName ( yourColumnName text, . . N );
Let us first create a table −
mysql> create table DemoTable -> ( -> MyStringValue text -> ); Query OK, 0 rows affected (0.67 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('This is a text data type to store large string'); Query OK, 1 row affected (0.17 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+------------------------------------------------+ | MyStringValue | +------------------------------------------------+ | This is a text data type to store large string | +------------------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- Best data type for storing currency values in a MySQL database?
- What is the best data type to store money values in MySQL?
- The best data type to store 0, 1, null values in MySQL?
- What is the data type for unix_timestamp in MySQL?
- What is the best data type to use for currency in C#?
- Storing money amounts in MySQL?
- Which MySQL Datatype should be used for storing BloodType?
- How should I store data into my Mysql database, what type should I assign to a column storing salt values?
- Which MySQL data type is used for long decimal?
- What data type to use for hashed password field in MySQL?
- HTML5 data-* attribute type casting strings and numbers
- What should one use CHAR data type or VARCHAR data type in MySQL?
- What is BLOB data type in MySQL?
- What is TEXT data type in MySQL?
- Technical SEO for Large Websites: Tips and Best Practices

Advertisements