cleary1981 Posted October 31, 2008 Share Posted October 31, 2008 Hi, Does anyone know of a good script i could use to backup my database. Im using windows and I want to back my db up locally but I want the script to run say once a week. Any pointers are much appreciated. I found this script but cant get it to work properly. <?php $backupFile = 'c:\backup\backup_'; $tableName = 'supplier'; $dbname = 'tes'; $dbhost = 'localhost'; $dbuser = 'admin'; $dbpass = 'password'; $backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz'; $command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile"; system($command); ?> Link to comment https://forums.phpfreaks.com/topic/130896-php-script-to-backup-a-mysql-database/ Share on other sites More sharing options...
Mchl Posted October 31, 2008 Share Posted October 31, 2008 Personally I use MySQL admin from MySQL GUI Tools. Lets you schedule regular backups. Only thing is, it's not compatible with mysqldump. so you have to restore through MySQL admin as well. Link to comment https://forums.phpfreaks.com/topic/130896-php-script-to-backup-a-mysql-database/#findComment-679452 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.