I want to create backup of my website database in which is in MySQL in another database on regular basis , is it possible to do it using php
Already tried exporting database using php but requirement is something else
I want to create backup of my website database in which is in MySQL in another database on regular basis , is it possible to do it using php
Already tried exporting database using php but requirement is something else
I think mysqldump
is what you're looking for.
Export database A to SQL file to import to database B:
mysqldump --host=localhost --user=dbauser --password=dbapassword dba_name > /path/to/store/dba.sql
Import database A dump into database B:
cp /path/to/store/dba.sql | mysql --host-localhost --user=dbbuser --password=dbbpassword dbb_name
You can wrap these commands in a call to system()
in a PHP script.