MySQL Database backup automatically on a windows server

后端 未结 5 1559
一向
一向 2020-12-24 05:48

Is there a way to back up MySQL database automatically at certain times of the day for designated servers or send an email with an attachment.. Which ever do you think is th

5条回答
  •  盖世英雄少女心
    2020-12-24 06:34

    You can add one of these commands to Windows task scheduler:

    mysqldump –-user [username] –-password=[password] [database name] > [dump file]
    

    or in a compact way:

    mysqldump –u[username] –p[password] [database name] > [dump file]
    

    or:

    mysqldump -u[user] -p[password] --result-file="c:\\backup.%DATE:~0,3%.sql" [database]
    

提交回复
热议问题