Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum length of a Column name in MySQL [closed]

Tags:

mysql

I am working with mysql and have a column name with length 70.
So, I am getting error which states that the column name is too long.
Now, I just want to know what is the maximum length of column name in mysql?

like image 934
user2440574 Avatar asked Jun 04 '13 14:06

user2440574


People also ask

What is the max column name length in MySQl?

The following table describes the maximum length for each type of identifier. Aliases for column names in CREATE VIEW statements are checked against the maximum column length of 64 characters (not the maximum alias length of 256 characters).

How long can a column name be in SQL?

Each object has maximum size limitations. SQL maximum column name length limitation is 128 characters. If we create more than 128 characters, it shows an error.

How long can a MySQl database name be?

Names for databases, tables, columns, and indexes can be up to 64 characters long. Alias names can be up to 256 characters long.


2 Answers

The following table describes the maximum length for each type of identifier.

Identifier                      Maximum Length (characters) Database                        64 Table                           64 Column                          64 Index                           64 Constraint                      64 Stored Procedure or Function    64 Trigger                         64 View                            64 Alias                           256  Compound Statement Label        16 
like image 132
Daanvn Avatar answered Oct 08 '22 20:10

Daanvn


Similar question is already answered Here
Anyway, Maximum allowed length of column name is 64 according to documentation : Mysql Documentation

like image 36
Waqas Malik Avatar answered Oct 08 '22 22:10

Waqas Malik