Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Location
    Northumberland, England
    Posts
    11

    Red face Unanswered: backup doesn't preserve foriegn characters

    I'm backing up a database I'm working on that contains a lot of text in French, and i've noticed that within the sql backup files, all of the French characters have been replaced by strange symbols, such as copyright logos and the like.

    How can I stop it from garbling this data?

    I have the Collation set to latin1_general_cs in the character set for the table. Is there something else that I need to perform?

    Thanks,
    Daf

  2. #2
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    You see that when you restore, or in the backup it-self?
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  3. #3
    Join Date
    Nov 2006
    Location
    Quebec
    Posts
    172
    Maybe you can perform this command to make your backup:

    mysqldump -Q --add-drop-table --default-character-set=utf8 --compatible=mysql40 --set-charset=utf8 DATABASENAME > BACKUP.SQL

    where DATABASENAME is the name of your database and BACKUP.SQL is the name of the sql dump file.

    Note that some parameters are optional like "--add-drop-table".
    Less is more.
    How long is now?
    http://www.lesouterrain.com

  4. #4
    Join Date
    Jan 2004
    Location
    Northumberland, England
    Posts
    11
    Hi Ortho,
    Just before I try your code suggestion I just wanted to say that I see it in the sql backup, but when I re-import this code the affected characters are imported incorrectly too.

  5. #5
    Join Date
    Jan 2004
    Location
    Northumberland, England
    Posts
    11
    just tried the command, and I'm still getting the weird characters. When I ran the command it said that the --set-charset had an invalid value for utf8 though.

  6. #6
    Join Date
    Oct 2007
    Posts
    3
    may be you should try this command:
    mysqldump -uusername -ppassword --default-character-set=latin1 databasename > backup.sql

    i think the parameter(--default-character-set) is the same as your database charset.

Posting Permissions

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