Strange characters in mysqldump output
Posted 30 April 2003 - 11:57 AM
I\'ve written a backup script which saves the output from a mysqldump and then prompts the uers to save the file. I have this working perfectly on my test server which is running apache on windows xp. But on the live server which is linux based the contents of the saved mysqldump are different.
I get these characters in the file :-
The mysqldump i run here is fine and formatted correctly when i look at it in notepad and i can import it into mysql using phpmyadmin with no problems.
But when i look at the version i download from the live server it has in it and the formatting is all over the place and i get errors if i try and import it in phpmyadmin.
I\'m sure i have set the correct mime-type and the headers are correct too.
Any ideas why?
Any help would be grealty appreciated
Posted 30 April 2003 - 12:07 PM
Posted 30 April 2003 - 12:14 PM
Well, heres a sample of the dump :-
`nALTER TABLE admin DISABLE KEYS */; -- -- Dumping data for table \'admin\'; -- --
thats the first line of the code, it does seem to be a carriage return problem as when i pasted that line above it appeared as:-
`nALTER TABLE admin DISABLE KEYS */;
-- Dumping data for table \'admin\'
Wonder why it would be different or changes characters when the same script running locally here works perfectly.
Would it be a case of converting some characters after the dump has run then?
Posted 30 April 2003 - 04:08 PM
Posted 30 April 2003 - 05:50 PM
I\'ll try and look at it in textpad...
Still leaves the problem that i can backup and restore a mysql database in windows but can\'t backup a mysql database in Linux and restore it on a Windows platform.
Will i need to convert the line endings or somthing?
Posted 01 May 2003 - 12:27 AM
Posted 01 May 2003 - 01:53 AM
By piping to unix2dos before gzip it converts all unix chars to dos / windows ones :-)
Posted 01 May 2003 - 12:44 PM
I have an index.php which has a button for backup. When backup is clicked it forwards the browser to backup.php where i set the header information for file saving and then echo the file.
The only thing is, after the file has been saved i\'d like to put a link on that page to direct them back to another page, but as the header has been set it just gets put in with the file being saved.
Is there someway of doing :-
header(\'Content-Disposition: attachment; filename=\"\'. $saveas_filename . \'\"\');
header(\'Cache-Control: must-revalidate, post-check=0, pre-check=0\');
<terminate output to file>
<continue with php and html for page content displayed to browser>
Help as always, is very much appreciated
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users