The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem restoring database 'DEFAULT CHARSET=latin1'

Discussion in 'General Discussion' started by BianchiDude, Dec 5, 2005.

  1. BianchiDude

    BianchiDude Well-Known Member
    PartnerNOC

    Joined:
    Jul 2, 2005
    Messages:
    619
    Likes Received:
    0
    Trophy Points:
    16
    Why am I getting this error?

    root@102 [/backup/cpbackup/monthly/kapp/mysql]# mysql kapp_newforum < kapp_newforum.sql
    ERROR 1064 at line 21: 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 10
     
  2. darkelder

    darkelder Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Which mySQL version do you use? My guess is that you're using mySQL 3 or 4.0 and your sql dump is from 4.1
     
  3. BianchiDude

    BianchiDude Well-Known Member
    PartnerNOC

    Joined:
    Jul 2, 2005
    Messages:
    619
    Likes Received:
    0
    Trophy Points:
    16
    Yes, my dump is from 4.1 and I am restoring to a server that has 4. How can I fix this?
     
  4. darkelder

    darkelder Well-Known Member

    Joined:
    Oct 8, 2004
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Edit dump and remove all "DEFAULT CHARSET=latin1" at end of lines that start with CREATE
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,448
    Likes Received:
    194
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I found this via google. Might be worth investigating.

     
  6. sanjuabrahamk

    sanjuabrahamk Active Member

    Joined:
    Jan 26, 2006
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    solution

    Hello,

    Simple solution. No need to edit the dump.

    Please take the dump from the server with mysql version 4.1 with the following command


    shell> mysqldump --create-options --compatible=mysql40 db_name > dump_file

    After that restore the dump to the server with mysql version 4.0

    It will work.

    Thanks
    Sanju Abraham :)

    www.logicsupport.com
     
Loading...

Share This Page