Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

backup mysql db using php

Codes here !

Moderators: macek, egami, gesf

backup mysql db using php

Postby ph » Thu Mar 13, 2003 2:29 am

Hello there!

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
ph
New php-forum User
New php-forum User
 
Posts: 6
Joined: Thu Mar 13, 2003 2:14 am

Postby Romantik » Thu Mar 13, 2003 3:08 am

Why you use ODBC in MySQL?
Romantik
New php-forum User
New php-forum User
 
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson

Postby ph » Thu Mar 13, 2003 4:32 am

I don't. It is a very strange error. But I've given up the hope of fixing that error, and I am looking for another method to export my database using php. Who can help me?
ph
New php-forum User
New php-forum User
 
Posts: 6
Joined: Thu Mar 13, 2003 2:14 am


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron