00 Votes

MySQL: Maximum Length of a Column and Table Name

Question by Guest | 2015-06-03 at 19:41

Currently, I am creating a new MySQL database and I had to recognize that some of my names for the columns and tables have become pretty long. The reason is that I am used to give names reflecting potential connections between the fields.

Now, I wonder how long a name of a column or a table in MySQL could actually be at the maximum? Or isn't there any limit?

3Best Answer3 Votes

The name of a table as well as the name of the column can consist of 64 characters at the maximum in MySQL.

Name ofMaximum Length
Stored Procedure or Function64
Compound Statement Label16

In this table, I have also listed all of the other limits for names and identifiers in MySQL.
2015-06-03 at 19:50

ReplyPositive Negative
11 Vote

Is it possible to increase the number of characters in the names of the tables?

So, from 64 characters to 100 characters, for example?
2020-09-15 at 21:12

ReplyPositive Negative
00 Votes

Since this is a limitation of MySQL, which is also stated in the documentation, I assume that this is not possible. Otherwise this possibility would also be described on that site.

What you can do is possibly (depending on the context) to go via the alias functionality. So "old_short_name AS new_long_name". 256 characters are allowed for this (more than 64).
2020-09-16 at 11:18

Positive Negative

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.


Ask your own question or write your own article on askingbox.com. That’s how it’s done.