SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict Philip Toews's Avatar
    Join Date
    Dec 2001
    Location
    Kuala Belait, Brunei
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    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?


    [img]images/smilies/smile.gif[/img]
    Philip Toews Professional esl Educator and ASP.NET wannabe

    http://www.philiptoews.com
    philip@philiptoews.com

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Needham, MA
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    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.

    HTH,
    Tom Mollerus
    tmollerus@oneworkspace.com
    http://www.oneworkspace.com The affordable, simple, and secure way to manage your projects online


Bookmarks

Posting Permissions

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