The following articles teach you how to correctly apply the daily backup MySQL database script. If you are interested in the actual operations related to the backup MySQL database script, you can click to view the following articles, I hope it will help you in this regard.
1 .#! /Bin/s
2. cd/home/MySQL (the best combination with PHP)-backup
3. rm alldb.5.tar.gz-f
4. mv alldb.4.tar.gz alldb.5.tar.gz>/dev/null 2> & 1
5. mv alldb.3.tar.gz alldb.4.tar.gz>/dev/null 2> &
6. mv alldb.2.tar.gz alldb.3.tar.gz>/dev/null 2> & 1
7. mv alldb.1.tar.gz alldb.2.tar.gz>/dev/null 2> & 1
8. mv alldb.0.tar.gz alldb.1.tar.gz>/dev/null 2> & 1
9. tar zcf alldb.0.tar.gz alldb. SQL>/dev/null 2> & 1
10. rm alldb. SQL-f
11. MySQL (the best combination with PHP) dump-all-databases-opt-ppassword> alldb. SQL
In the last sentence above-the password of ppassword indicates the password of the root account. Change it to the password of the root account of your own database, alternatively, you can create a backup user to replace the root account. In addition, make sure that the/home/MySQL (the best combination with PHP)-backup directory exists.
Finally, change the MySQL database Script Attribute to 755, and the owner is root. root, put it in/etc/cron. in the daily directory, you can back up the database once a day and cycle it every week. If dual-Machine backup is added, the system is more secure.
The same method can be used to back up website content and dns databases.
The above content is an introduction to backing up MySQL database scripts every day. I hope you will find some gains.