MySQL error - please help me out?

Discussion in 'MySQL' started by lokielookies, Mar 17, 2007.

  1. #1
    The following mysql error pops up while importing a database

    Error

    SQL query:

    CREATE TABLE `test` (
    `name` varchar( 50 ) NOT NULL default '',
    `url` text NOT NULL ,
    `test` text NOT NULL ,
    `time` int( 10 ) NOT NULL default '0',
    PRIMARY KEY ( `name` , `time` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1

    MySQL said: Documentation
    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1' at line 7


    Can someone please tell me what this means and how to fix?


    Greetz!
    Mieke
     
    lokielookies, Mar 17, 2007 IP
  2. Lavee

    Lavee Well-Known Member

    Messages:
    234
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Change the latin1 to utf8. I think this is because of mysql compatability issue.

    Thanks

    Lavee
     
    Lavee, Mar 17, 2007 IP
  3. Wyla

    Wyla Well-Known Member

    Messages:
    924
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    140
    #3
    should there be a ; at the end?
     
    Wyla, Mar 17, 2007 IP
  4. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I can execute this SQL query, can you report your MySQL version?
     
    tanfwc, Mar 17, 2007 IP
  5. Lavee

    Lavee Well-Known Member

    Messages:
    234
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #5
    The semicolon is needed only if he puts multiple queries in one file and executes it. Otherwise thats not the issue. changing to utf8 should work

    Thanks

    Lavee
     
    Lavee, Mar 17, 2007 IP
  6. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #6
    For the initial poster. You will need to replace all occurences within the dump file if there is more than one table. Do not use a word processor to open you file and replace the text. Notepad with word wrap off is okay.
     
    Colbyt, Mar 17, 2007 IP
  7. amitpatel

    amitpatel Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hy
    You can tell me what is meaning of this sentence "ENGINE = MYISAM DEFAULT CHARSET = latin1" I don't getting this line what it want to tell
     
    amitpatel, Mar 31, 2007 IP