Results 1 to 6 of 6

Thread: Problem restoring database 'DEFAULT CHARSET=latin1'

  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jul 2005
    Posts
    621

    Default Problem restoring database 'DEFAULT CHARSET=latin1'

    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. #2
    Member
    Join Date
    Oct 2004
    Posts
    74

    Default

    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
    Roberto,

    cPanel articles at cpWiki.org

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jul 2005
    Posts
    621

    Default

    Quote Originally Posted by darkelder
    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
    Yes, my dump is from 4.1 and I am restoring to a server that has 4. How can I fix this?

  4. #4
    Member
    Join Date
    Oct 2004
    Posts
    74

    Default

    Edit dump and remove all "DEFAULT CHARSET=latin1" at end of lines that start with CREATE
    Roberto,

    cPanel articles at cpWiki.org

  5. #5
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    10,067
    cPanel/WHM Access Level

    Root Administrator

    Lightbulb

    I found this via google. Might be worth investigating.

    I didn't catch whether the original postee still has access to the old database, but for future reference, the mysql 4.1.x version of mysqldump (the command line backup utility) has a backwards compatibility switch.

    --compatible=name
    Produce output that is compatible with other database systems or with older MySQL servers. The value of name can be ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, or no_field_options. To use several values, separate them by commas. These values have the same meaning as the corresponding options for setting the server SQL mode.

    Every time I backup my db I do so with each of mysql323, mysql40 and without the switch so no matter where I go in the future, should the need arise, I have a usable backup.

  6. #6
    Member
    Join Date
    Jan 2006
    Location
    India
    Posts
    31

    Default 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

Similar Threads

  1. mysql default charset
    By section31 in forum cPanel & WHM Discussions
    Replies: 8
    Last Post: 08-26-2010, 04:42 PM
  2. Problem Restoring A Database
    By joben1 in forum Database Discussions
    Replies: 4
    Last Post: 02-24-2008, 06:14 PM
  3. default charset
    By lukaschemp in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 12-27-2007, 08:19 AM
  4. Replies: 0
    Last Post: 05-29-2006, 12:31 PM
  5. Problem restoring Database
    By snadboy in forum Database Discussions
    Replies: 2
    Last Post: 05-09-2005, 05:41 AM