Using php to back up the mysql database is to generate data. SQL file, so that even if the data backup is successful, you can directly read and execute it one by one during recovery. The following provides some backup examples for your reference. for example, the code is as follows :?... Using php to back up the mysql database is to generate data. SQL file, so that even if the data backup is successful, you can directly read and execute it one by one during recovery. The following provides some backup examples for your reference.
The code is as follows:
// Example, the code is as follows:
//! /Usr/bin/php
". $ SQL _dir; system ($ execs); if (file_exists ($ SQL _dir. '.gz ') {unlink ($ SQL _dir. '.gz ');} system ('gzip '. $ SQL _dir );}}
// Example, the code is as follows:
Create ($ filename); if ($ v_list = 0) {die ("Error :". $ archive-> errorInfo (true);} if (file_exists ($ filename) {unlink ($ filename);} echo "Mysql's backup successfully ". $ filename. ". zip ";?>
The Zip package backup code is almost a full copy of the demo, which is too convenient. the code is as follows:
Create ($ src); if ($ v_list = 0) {die ("Error :". $ archive-> errorInfo (true);} else {print ("Success") ;}?>
The file of pclzip. lib. php is not provided here.
Article address:
Reprint at will ^ please include the address of this article!