xampp mysql 备份_Linux Xampp计划任务自动备份Mysql数据库和所有网站
[inlosc_lg_title]1、備份[/inlosc_lg_title]
使用XAMPP的PHP網站集成環境,不僅輕松的解決網站所需環境,他的備份功能也非常強大。下面讓我們輸入幾句命令來完成數據庫和網站的自動備份:
/opt/lampp/lampp backup **** #命令后面跟著的是MySQL 的 root 用戶的密碼。命令執行后會看到下面的內容:
Backing up databases...
Backing up configuration, log and htdocs files...
Calculating checksums...
Building final backup file...
Backup finished.
Take care of /opt/lampp/backup/xampp-backup-19-02-06.sh
[inlosc_lg_title]2、恢復[/inlosc_lg_title]
恢復以前的備份,只需以 root 用戶身份運行下面的命令:
sh /opt/lampp/backup/xampp-backup-19-02-06.sh **** #命令后面跟著的是MySQL 的 root 用戶的密碼,這時用戶將看到如下信息:
Checking integrity of files...
Restoring configuration, log and htdocs files...
Checking versions...
Installed: XAMPP 1.5.1
Backup from: XAMPP 1.5.1
Restoring MySQL databases...
Restoring MySQL user databases...
Backup complete. Have fun!
You may need to restart XAMPP to complete the restore.
恢復完后,需要重新啟動XAMPP,才能使恢復的數據可用。
[inlosc_lg_title]3、創建計劃任務[/inlosc_lg_title]
xampp平臺在linux系統中mysql數據庫的數據文件目錄 /opt/lampp/var/mysql
備份可以直接添加到crontab上。
crontab -e
0 0 1 * * /opt/lampp/lampp backup ****(數據庫密碼)
總結
以上是生活随笔為你收集整理的xampp mysql 备份_Linux Xampp计划任务自动备份Mysql数据库和所有网站的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 观后感
- 下一篇: php mysql installed_