Entry
How can I backup a MySQL database through PHP only?
Can I backup my database using PHPMyAdmin?
Is it possible to create a PHP script to backup a mySQL database?
Is it possible to create a PHP script to backup a mySQL database?
Jul 2nd, 2000 16:22
Philip Olson, Nathan Wallace, Kevin Edwards, Kevin Yank
Try phpMyAdmin:
http://www.phpwizard.net/phpMyAdmin/
As well as a great tool for administering your MySql database, it allows
you to download a dump of the entire database through your web browser.
To do it the old manual way, do this :
mysqldump -u username -p dbname > dumpname.sql
it'll prompt you for your password & create a dump called dumpname.sql
If you're not doing this locally then you wanted to do this :
mysqldump -h source.host.name -u username -p dbname > dumpname.sql
Now, to put this back into a database, do this :
mysql -u username -p dbname < dumpname.sql
And in case you're putting this in a new database, first create one
like this :
mysqladmin -u username -p newdbname
And remember, if you're not doing this locally, add the -h stuff.