Wednesday, November 24, 2010

Get mysql db backup in same server

For huge mysql database backup you can try this code
Just write php script in your server which contact the following code
Replace the username with your username and password with your password and dbname your databasename . must be remember your you will add you u before username and p before password.


$db=’mysqldump -uusername_craig –ppassword dbname > /yourpath/youfile.sql';
system($db);

For Import large data

$db=’mysql -uusername_craig –ppassword dbname < /yourpath/youfile.sql';
system($db);