How to fix ERROR 1074: Column length too big in MySQL

MySQLINTERMEDIATEMEDIUMUpdated Dec 22, 2025· 169 views

MySQL Error 1074 occurs when a VARCHAR or CHAR column exceeds the maximum byte limit of 65,535 bytes. The actual character limit depends on your character set (UTF-8, GBK, Latin1), and can be reduced when using multi-byte encoding.

Quick fix

Fixes ERROR 1074: Column length too big

SHOW CREATE TABLE your_table_name\G
  1. Check your column declaration and character set
  2. Reduce the VARCHAR column size
  3. Consider using TEXT or MEDIUMTEXT for large content
  4. Review the total row size across all columns
mysql — error
SHOW CREATE TABLE your_table_name\G
ERROR 1074: Column length too big

What this error means

MySQL Error 1074 (SQLSTATE: 42000) is raised when you attempt to create or modify a table with a column length that exceeds MySQL's maximum allowed size. The error message indicates both the column name and the actual maximum length allowed, which varies based on the data type and character set. This is not a memory or hardware limitation, but rather a constraint built into MySQL's design. VARCHAR columns can store up to 65,535 bytes total, but this is a shared limit across all columns in a row. Additionally, when using multi-byte character encodings like UTF-8, the effective character limit is much lower because each character consumes multiple bytes. The error typically appears during table creation (CREATE TABLE) or when modifying a table structure (ALTER TABLE ... MODIFY COLUMN).

Typical symptoms

  • Error appears immediately when creating a table with large VARCHAR columns
  • Error message shows "(max = 21845)" or similar reduced maximum when using UTF-8
  • Altering an existing table to increase VARCHAR size fails with this error
  • Character limit appears unexpectedly lower than the declared column size
  • ALTER TABLE statements fail when increasing column length specifications

Common causes

  1. Declaring VARCHAR or CHAR larger than 65,535 bytes in total row size
  2. Using UTF-8 character set which consumes 3 bytes per character, limiting VARCHAR(65535) to approximately 21,845 characters
  3. Combining multiple large VARCHAR columns that exceed the 65,535 byte row limit when summed together
  4. Using multi-byte character encodings (GBK, UTF-8) without accounting for byte consumption per character
  5. Exceeding the per-column maximum based on character set (e.g., 21,845 for UTF-8)

How to fix "ERROR 1074: Column length too big"

1Check your column declaration and character set

First, understand what character set your database or table uses and how many bytes each character requires. Run:

sql
SHOW CREATE TABLE your_table_name\G

Look for the CHARSET definition. Common character sets:
- latin1/iso-8859-1: 1 byte per character → max 65,535 character limit
- utf8mb3: 3 bytes per character → max 21,845 character limit (65,535 ÷ 3)
- utf8mb4: 4 bytes per character → max 16,383 character limit (65,535 ÷ 4)
- GBK: 2 bytes per character → max 32,767 character limit (65,535 ÷ 2)

2Reduce the VARCHAR column size

The simplest fix is to reduce the declared size of your VARCHAR column to stay within limits. For UTF-8 databases, use VARCHAR(21845) or less:

sql
-- Wrong (fails with Error 1074 on UTF-8)
CREATE TABLE users (
  description VARCHAR(65535)
);

-- Correct (respects the 65,535 byte limit for UTF-8)
CREATE TABLE users (
  description VARCHAR(21845)
);

-- Or use TEXT for unlimited length
CREATE TABLE users (
  description TEXT
);

For existing tables, use ALTER TABLE:

sql
ALTER TABLE users MODIFY COLUMN description VARCHAR(21845);
3Consider using TEXT or MEDIUMTEXT for large content

If you need to store more than your VARCHAR limit allows, use TEXT data types:

sql
-- For content up to 65,535 bytes
CREATE TABLE articles (
  content TEXT
);

-- For content up to 16MB
CREATE TABLE documents (
  content MEDIUMTEXT
);

-- For content up to 4GB
CREATE TABLE archives (
  content LONGTEXT
);

TEXT types don't count toward the 65,535 byte row limit and can store much larger content. However, they're slightly slower to index and query compared to VARCHAR.

4Review the total row size across all columns

Remember that the 65,535 byte limit is shared across ALL columns in a row, not per column. If you have multiple large VARCHAR columns, they sum together:

sql
-- This may fail if total > 65,535 bytes
CREATE TABLE products (
  name VARCHAR(10000),
  description VARCHAR(10000),
  details VARCHAR(10000),
  notes VARCHAR(10000),
  comments VARCHAR(10000)
);
-- Total: 50,000 bytes - OK

-- This will fail
CREATE TABLE products (
  name VARCHAR(20000),
  description VARCHAR(20000),
  details VARCHAR(20000),
  notes VARCHAR(20000),
  comments VARCHAR(20000)
);
-- Total: 100,000 bytes - EXCEEDS LIMIT

To fix: either reduce individual VARCHAR sizes or move some columns to a separate table (normalization).

5If necessary, change the character set to single-byte

As a last resort, you can change your database or table to use a single-byte character set like Latin1, which allows VARCHAR(65535). However, this is rarely recommended because:

1. You lose support for Unicode characters
2. Modern applications expect UTF-8 support
3. It may break existing client code

If you must do this:

sql
-- Change entire table to Latin1
ALTER TABLE users CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;

-- Or for a specific column
ALTER TABLE users MODIFY COLUMN description VARCHAR(65535) CHARACTER SET latin1;

Only use this approach if you're certain you don't need Unicode support.

Advanced notes

UTF-8 Variants: MySQL has three UTF-8 implementations. The legacy utf8 is actually utf8mb3 (3 bytes max). Use utf8mb4 (4 bytes) for full Unicode support including emojis. The byte limits are:
- utf8mb3: 65,535 ÷ 3 = 21,845 characters
- utf8mb4: 65,535 ÷ 4 = 16,383 characters

InnoDB Row Format: Different row formats have different maximum row sizes. COMPRESSED and DYNAMIC formats may have different limits than COMPACT. Check your table's row format with SHOW CREATE TABLE.

NULL and Storage Overhead: The actual space calculation includes a 1-2 byte length prefix for VARCHAR and potential NULL value storage. This can slightly reduce the effective maximum.

Migration Strategy: When converting large VARCHAR to TEXT, be aware that some applications may expect VARCHAR behavior (e.g., default collation handling). Test thoroughly before deploying to production.

Frequently asked questions

What does "ERROR 1074: Column length too big" mean?
MySQL Error 1074 (SQLSTATE: 42000) is raised when you attempt to create or modify a table with a column length that exceeds MySQL's maximum allowed size. The error message indicates both the column name and the actual maximum length allowed, which varies based on the data type and character set. This is not a memory or hardware limitation, but rather a constraint built into MySQL's design.
How do I fix "ERROR 1074: Column length too big"?
MySQL Error 1074 occurs when a VARCHAR or CHAR column exceeds the maximum byte limit of 65,535 bytes. The actual character limit depends on your character set (UTF-8, GBK, Latin1), and can be reduced when using multi-byte encoding.
What causes "ERROR 1074: Column length too big"?
Declaring VARCHAR or CHAR larger than 65,535 bytes in total row size Using UTF-8 character set which consumes 3 bytes per character, limiting VARCHAR(65535) to approximately 21,845 characters Combining multiple large VARCHAR columns that exceed the 65,535 byte row limit when summed together
Is the "ERROR 1074: Column length too big" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading