mysqldump doesn't work in crontab

前端 未结 9 2144
我寻月下人不归
我寻月下人不归 2020-12-08 21:26

I\'m trying to add a cronjob in the crontab (ubuntu server) that backups the mysql db.

Executing the script in the terminal as root works well, but inserted in the c

9条回答
  •  醉话见心
    2020-12-08 21:49

    Local Host mysql Backup: 0 1 * * * /usr/local/mysql/bin/mysqldump -uroot -ppassword --opt database > /path/to/directory/filename.sql

    (There is no space between the -p and password or -u and username - replace root with a correct database username.)

    It works for me. no space between the -p and password or -u and username

提交回复
热议问题