MySQL error: The maximum column size is 767 bytes MySQL error: The maximum column size is 767 bytes database database

MySQL error: The maximum column size is 767 bytes


With the help of the answer given by BK435, I did the following and solved the problem.

set global innodb_file_format = BARRACUDA;set global innodb_large_prefix = ON;create table test (........) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;


Your column that you are trying to index is too large and your settings must not be correct for innodb_large_prefix. There are a couple prerequisites parameters that also have to be set in order for innodb_large_prefix to work correctly.

You can check to make sure that innodb_large_prefix is set by running:

show global variables like 'innodb_lar%';

Here are a couple prerequisites for using innodb_large_prefix:

You need to set your global variable innodb_file_format=BARRACUDA

to check settings run: show global variables like 'innodb_fil%';

At the table level you have to use ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED

for Innodb, rows are stored in COMPACT format (ROW_FORMAT=COMPACT) by default.


I was using MariaDB version 10.1.38 and used all of the below given commands but it did not work -

set global innodb_large_prefix = ON;Query OK, 0 rows affected (0.00 sec)set global innodb_file_per_table = ON;Query OK, 0 rows affected (0.00 sec)set global innodb_file_format = Barracuda;Query OK, 0 rows affected (0.00 sec)SET GLOBAL innodb_default_row_format = 'DYNAMIC';

Because after you restart your MySQL (or MariaDB), these settings will not reflect back using the command at the mysql prompt: show variables like 'innodb%';

Then I edited My.ini and added these settings in the file at below location-C:\xampp\mysql\bin\my.ini

## Innodb settings to bypass error of max size 737innodb-file-format=barracudainnodb-file-per-table=ONinnodb-large-prefix=ON## Above 3 didnot work so i added belowinnodb_default_row_format = 'DYNAMIC'

source:https://www.experts-exchange.com/questions/28675824/Why-am-I-unable-to-turn-innodb-large-prefix-ON-successfully-Every-time-I-reboot-mySql-on-my-Ubuntu-VPS-it-resets-to-OFF.html