tar corrupts my sql file
Posted: Fri Jul 11, 2008 8:08 pm
I backed up my database using this code:
now I'm trying to restore my database by uploading the file and then run this code
now my sql file is extracted successfully but the content has lots of special characters, words misspelled etc.
what could be the problem with my script?
TIA
Code: Select all
exec("mysqldump --opt --host=$db_host --user=$db_user --password=$db_pass '$db_name' > $filename.sql");
exec("tar czvf $filename.tar.gz $filename.sql");
Code: Select all
exec("tar -zxvf $filename", $file);
exec("mysql --verbose --user=$db_user --password=$db_pass $db_name < ".$db_name."-db-globackup.sql", $result, $response);
what could be the problem with my script?
TIA