SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict Philip Toews's Avatar
    Join Date
    Dec 2001
    Kuala Belait, Brunei
    0 Post(s)
    0 Thread(s)

    MySQL dump error

    I am transferring a MySQL DB from one server to another and get the following error:

    CREATE TABLE answer_choices( id int( 11 ) NOT NULL auto_increment,
    question_id int( 11 ) DEFAULT '0' NOT NULL ,
    text text NOT NULL ,
    display_order smallint( 4 ) DEFAULT '0' NOT NULL ,
    correct tinyint( 1 ) DEFAULT '0' NOT NULL ,
    picture_id int( 11 ) DEFAULT '0' NOT NULL ,
    PRIMARY KEY ( id ) ,
    KEY text( text )
    MySQL said:

    BLOB column 'text' used in key specification without a key length

    The dump code was generated from PHPMyAdmin. I'm surprised that I get errors.

    What setting should I change in phpMyAdmin to get a proper dump file?

    Philip Toews Professional esl Educator and ASP.NET wannabe

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Needham, MA
    0 Post(s)
    0 Thread(s)
    From the mySQL documentation:
    # Only the MyISAM table type supports indexing on BLOB and TEXT columns. When putting an index on a BLOB or TEXT column you MUST always specify the length of the index:

    CREATE TABLE test (blob_col BLOB, INDEX(blob_col(10)));
    I don't know why an incorrect dump file would be generated for you, but at least this should give you an idea of how to fix it manually.

    Tom Mollerus The affordable, simple, and secure way to manage your projects online


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts