phemellc / yii2-settings

Yii2 Settings Module
Other
151 stars 74 forks source link

ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes #42

Closed zorobabel closed 8 years ago

zorobabel commented 8 years ago

This error appears after I import my db in my production server.

I solved this changing section and key fields to VARCHAR(128) in settings table.

I think the migration needs to be updated or do you have another solution?

PD: I use a shared hosting.

arisk commented 8 years ago

Hi. If your Database is UTF-8 then VARCHAR(255) should work. Can you check the character set of your database? It's gonna be difficult to reduce the column size since it might break existing apps.

zorobabel commented 8 years ago

Aris, thanks.

The collation of my db is utf8_general_ci.

It's gonna be difficult to reduce the column size since it might break existing apps.

I agree.

This error was giving me a lot of headaches.

zorobabel commented 8 years ago

I had to change the column definitions to VARCHAR(128) :(

Sorry I am not a MySQL expert