MySQL UTF8 backup and restore

Discussion in 'Databases' started by pkampolis, Jul 12, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,
    I have a mySQL database on discountasp. All my tables are createdwith "DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" and some columns with "collate utf8_unicode_ci". All my website works with utf8. Everything works fine as for selecting, updating and inserting throught the web site (mainly using fence, german and greek). The problem is that when I backup my database using mysqldump I get "trash" characters in my .sql backupfile. When I try to restore this file to my local mysql the data is "trashed".

    The mysqldump command I'm using to backupis :
    mysqldump -umyuser --password=mypwd -Q --add-drop-table --default-character-set=utf8
    --set-charset=utf8 -hdisountasphostMYDISCOUNTASPDB > C:\backups\discount_backup_12_7_2007.sql

    The file "discount_backup_12_7_2007.sql" generated is UTF8 encoded but the data is trashed.
    Of course when I try to restore the file on a local mysql DB I get trash in the database.

    This worries me a lot bacause this is exactly the problem that caused me tomove from my previous host. They restored from a "trashed" backup file and I lost about a month's data!

    As my local DBengine I use mysql4.1.21 with everything set to utf8. Meaning when Ido SHOW VARIABLES; everything that has to do with charsets and encodings is set toutf8.
    On my discountasp db when I try SHOW VARIABLES; I get a lot of latin1 records.

    If anyone knows a way to do a proper UTF8 backup please let me know.

    Thank you all,
    pantelis



    Post Edited (pkampolis) : 7/12/2007 8:15:40 PM GMT
     
  2. Nothing, No one?
    No one uses UTF8 data? Any DASP members have an idea about this?

    Thanks again,
    Pantelis.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page