Tag:Scheduled database backup

  • The implementation of regular backup of MySQL database


    1. Create a shell script vim backupdb.sh Create the script as follows: #!/bin/sh db_user=”root” db_passwd=”123456″ db_name=”userdb” name=”$(date +”%Y%m%d%H%M%S”)” /usr/bin/mysqldump -u$db_user -p$db_passwd $db_name >>/home/backup/$name.sql Explain: /Usr / bin / mysqldump: the path of mysqldump backup tool under the MySQL database installation directory Dbname: the name of the database to be backed up /Home / backup / […]