Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table comment length in MySQL

According to MySQL manual, table comments are limited to 60 characters. I'm designing the schema in MySQL Workbench, which does not enforce this limit, so I end up with writing more than 60 symbols quite often, and this causes the SQL script to fail. To tell the truth I would be quite happy with table comments being internal to my schema (i.e. not exported to the actual database), but Workbench doesn't allow this either. Hence my question: is there a way to increase maximum length of table comment in MySQL to 255?

like image 881
azerole Avatar asked Dec 24 '08 12:12

azerole


People also ask

What is /* in MySQL?

This is a type of comment. The /* is the beginning of a comment and */ is the end of comment. MySQL will ignore the above comment.

What is the maximum length in characters for a MySQL table?

The maximum length of a table name is 64 characters long according to MySQl version 8.0.

What is length values in MySQL?

The length can be specified as a value from 0 to 65,535. The effective maximum length of a VARCHAR is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used.


2 Answers

According to this bug report, Workbench was fixed in 5.0.18 to not allow comments over 60 characters.

I'm pretty sure there's no way to increase the limit, but if you turn off strict mode (even temporarily while you import) then it should truncate it with a warning instead of throwing an error.

like image 149
Greg Avatar answered Sep 28 '22 07:09

Greg


I came here from google - There is no way (besides the patch), but the comment lengths have been significantly increased, as I summed up here https://stackoverflow.com/a/14502814/857958

like image 21
nico gawenda Avatar answered Sep 28 '22 09:09

nico gawenda