Restoring issues - encoding error (UTF-8)

Post your support requests/solutions for phpMySQLAutoBackup [website]
MODS thats what I do that is! But definately NO mod music! It has to be ROCK!
Posts: 1810
Joined: Mon Oct 25, 2004 8:20 pm
Location: Huddersfield, UK

Restoring issues - encoding error (UTF-8)

Postby davidgwalker » Fri Jul 30, 2010 8:47 am

I have received several emails regarding problems restoring from backups.

In many cases it is the encoding you may be using, such as UTF-8 encoding (

Christian Thompson suggested this simple solution:
    Add the following lines after the mysql_connect() statement:

    mysql_query("SET session character_set_results = 'UTF8'");
    mysql_query("SET session character_set_client = 'UTF8'");
    mysql_query("SET session character_set_connection = 'UTF8'");
    mysql_query("SET session character_set_results = 'UTF8'");
    mysql_query("SET session character_set_server = 'UTF8'");

    As you can guess this gets the system "thinking" in UTF8. Also, I made sure
    the .php script files were encoded in UTF8.

Also when creating the tables you should specify the encoding like this:

And use the statement "SET NAMES 'utf8'" EACH TIME you connect to mysql
(via the command-line or from PHP scripts - as above).
There is also more details here:,66007,66007
(also search the MySQL forum for other posts)

Hope that helps anyone with similar issues.

ps. Want to add/modify anything to above then please contact me:

Return to “phpMySQLAutoBackup [forum]”

Who is online

Users browsing this forum: No registered users and 1 guest