Forum Moderators: coopster

Message Too Old, No Replies

Importing a large database

Importing a large database

         

Theory

10:49 am on Jun 22, 2004 (gmt 0)

10+ Year Member



I have a back of mysite in sql. And it appears that line 4114 is currupt or something.

Query: CREATE TABLE dstore ( uid varchar(255), name text, value text, enteredtime timestamp(14), id int(11) NOT NULL auto_increment, PRIMARY KEY (id), KEY nameidx (name) );

MySQL: BLOB column 'name' used in key specification without a key length

I'm using bigdump to import it. is there any other script that will do this where I can make it skip that line? I can't open in it and remove the line do to the database is far to large for that. Any help is greatly apprecaited.

timster

1:07 pm on Jun 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The error is that MySQL requires you specify how much of the text field to index, like so:

CREATE TABLE dstore ( uid varchar(255), name text, value text, enteredtime timestamp(14), id int(11) NOT NULL auto_increment, PRIMARY KEY (id), KEY nameidx (name(255)) );

Since the loadfile is too much to open easily, I'd suggest reading it with a script and using a regex to replace the problem code:

$newString = preg_replace('/nameidx name\)/', 'nameidx name(255))', $string);