I want to backup a mysql database using only a php script. I had such a script, on a linux/apache/php 4.1.2 system. This was the script:
- Code: Select all
<?php
exec ("mysqldump --opt -uUSERNAME -pPASSWORD DATABSENAME > /usr/local/apache/htdocs/sitename/backup.sql");
?>
I then made a link to the backup.sql file, and by loading the .php page, people could very easy make a backup (stored in the directory noted above), and download it (simply load the backup.sql file). Now I moved the website to an other machine (windows/iis 5.0/php 4.3.1), and the script isn't working anymore! I don't know whether it is becaus it's another web server or because it is another php version, but it won't work! Of course I redefined the path (to something like c:\www\sitename\backup.sql), but it get the very strange error "Access denied for user: 'ODBC@localhost' (Using password: NO)"
I do not mind using another method, the only thing I want is a simple to use script you can use in a php page, which creates a backup of the database (NOTE: something with 'into outfile' would also be great, I don't need the structure of the database).
Is there someone who knows how to do this?
Thanks in advance,
Paul

