[fix] Database error 1071 'Specified Key was too long'

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

[fix] Database error 1071 'Specified Key was too long'

Postby samtherobot » 10:05pm, Tue 08 Jan, 2008

For me this problem occurred because phplist cannot use utf8 tables from what I can tell. There are others who describe the details of this problem in these forums.

The easiest solution is to make sure your database is defaulted to latin1 as the character set for any new tables. To find out what the current default is run this SQL code:
Code: Select all
SHOW CREATE DATABASE databasename

If the encoding shows up as utf8, run the following SQL code on the same table:
Code: Select all
ALTER DATABASE databasename DEFAULT CHARACTER SET latin1


Then run the phplist initialize. If you had run it and it failed, make sure you delete the tables before initializing again.

If you want to change the default encoding back to utf8 for future tables, run this code:
Code: Select all
ALTER DATABASE databasename DEFAULT CHARACTER SET utf8
samtherobot
phpList newbie
 
Posts: 4
Joined: 6:49pm, Sun 30 Jul, 2006

Postby H2B2 » 6:15am, Wed 09 Jan, 2008

H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby tiscarabee » 4:48pm, Mon 30 Mar, 2009

again, my message is refused because spammer prevents...
:|

An idea to contact admin ? PM ? Who ?

Sorry, I will post the description of my bugfix...

Shortly, i've changed email by email(233) in the structure php file, in admin directory (line 72) -> re-initialize tables, and it works.

Code: Select all
index_2" => array("emailnameidx (email(233),name)",""),


Thks Michiel and all !

tisco
tiscarabee
PL Nut
 
Posts: 15
Joined: 4:44pm, Wed 18 Mar, 2009

Re: [fix] Database error 1071 'Specified Key was too long'

Postby yawarakai » 7:07pm, Thu 21 May, 2009

Thanks. I tried that now it turns into an error 1064. I am going to hate that number soon. I hear it is because I have MySQL 5
yawarakai
phpList newbie
 
Posts: 4
Joined: 10:06am, Tue 02 Jan, 2007

Re: [fix] Database error 1071 'Specified Key was too long'

Postby tiscarabee » 9:12am, Mon 25 May, 2009

I have mysql 5 too.
tiscarabee
PL Nut
 
Posts: 15
Joined: 4:44pm, Wed 18 Mar, 2009


Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

cron