From: John J. <jj...@as...> - 2007-07-17 18:45:13
|
Hi, I tried the change below and have a partially working system. I still get errors in the course, so I decided to create a new course. When I do that (using the command line utility), I get an error DBD::mysql::db do failed: Specified key was too long. Max key length is 500 at /opt/devel/webwork-modperl/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 111. Are these key lengths specified inside webwork (so that I can reduce them for this system)? John P. Gavin LaRose wrote: > Hi John, > > I'm running MySQL 4.1.20 on my servers, and think the script ran fine > there. The offending line is > $dbh->do("CREATE TABLE locations (location_id TINYBLOB NOT NULL, > description TEXT, PRIMARY KEY (location_id(1000)))"); > My bet from the error message is that the assignment of a prefix of 1000 > bytes is causing the error; I wonder if the implementation of TINYBLOB is > having trouble with the 1000 byte value on your machine, or in MySQL 4.0. > > In fact, the MySQL 4.0/4.1 documentation indicates that "Before MySQL > 4.1.2, the limit is 255 bytes for all tables." So that sounds like it's > likely to be the problem. If you change the prefix value to 255 it should > work for you, and we might want to document somewhere that the assumption > is that users are running MySQL 4.1.2 or better (or change the 1000 to > 255). > > Gavin > > |