All posts tagged: Backup

Using PHP to backup MySQL databases

81 comments

This post shows how to perform a partial or full backup of MySQL databases using only PHP code. This is very useful for example when a client doesn’t provide you with access data to the database of a web application and you only have an FTP connection available, or when you do have the connection data to the database but you can’t access it through the network (only available from localhost) and you can’t use tools like mysqldump to back up the information you need because you don’t have privileges for this, or simply because you have no access to a shell to which connect and run commands.

UPDATE (08-28-2017): moved the source code from myphp-backup.php and myphp-restore.php scripts to my GitHub daniloaz/myphp-backup repositoryhttps://github.com/daniloaz/myphp-backup

DanielUsing PHP to backup MySQL databases