Dumping the mysql database problem with Arabic characters and the solution

November 19, 2005

In the name of Allah
welcome all
when I start this blog at my PC I want to have a periodic backup from the database , then the problems start to appear
As I am muslim, arabian and egyptian man I will write Arabic words in my blog but when I backup my database and restore it an arabic character called fa’ ? goes to strange symbols .
First I think because the database encoding I try all possible encoding to solve that problem I try utf8-general-ci,utf8-unicode-ci and the problem still exist then I ask in my faculty group and in linux group
the faster reply was the linux one -offcourse-
the reply was when database support utf8 the problem appear with arabic and when the database doesn’t support utf8 there is no problem no sense
the soultion was to use the –compatible=mysql40 parameter
the full syntax is like
$mysqldump –compatible=mysql40 –opt mydatabase >mysqlfile.sql -u root -p
and ofcourse to restore the database again use
$mysql -uroot -p mydatabase