Restore MySQL DB with Unicode characters (Arabic and Kurdish) in .gz format

后端 未结 2 829
礼貌的吻别
礼貌的吻别 2020-12-10 23:43

I have a MySQL backup file in .gz format that was created by the backup wizard in cPanel. When the restoration is done by the backup wizard, contents with Arab

2条回答
  •  鱼传尺愫
    2020-12-10 23:54

    I added the lines

    character-set-server=utf8
    collation-server=utf8_general_ci
    

    to the mysqld section of /etc/mysql/my.cnf on my new server, then exported the data using

    mysqldump oldDB --default-character-set=latin1 -r dbCopy.sql

    and imported it into the new DB using

    mysql> SOURCE dbCopy.sql. Worked like a charm...

提交回复
热议问题