Mysql自动备份与还原方法
时间:2024-01-15 03:19:32
一、自动备份:将以下代码保存为*.bat批处理脚本,然后再添加Windows定时作业,如每天凌晨2点执行:
set s=%date:~0,4%%date:~5,2%%date:~8,2%%time:~1,1%%time:~3,2%%time:~6,2%
mysqldump -u root -ppassword databasename > d:\databasename_%s%_bak.sql
说明:databasename 为数据库名 password为数据库密码,系统自动以当前日期时间备份至指定目录。
二、还原数据库: mysql -u root -p databasename <d:\databasename.sql
标签:Mysql,自动备份,还原
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
php swoft框架实例用法
2024-05-11 09:45:02
不支持RSS,如何跟踪网站的内容更新?
2008-09-08 12:38:00
IE中jscript/javascript的条件编译
2007-10-03 14:03:00
设计师的底线
2009-05-06 12:51:00
对python中各个response的使用说明
2023-01-20 02:43:16
![](https://img.aspxhome.com/file/2023/6/115226_0s.jpg)
SQL Server误区30日谈 第20天 破坏日志备份链之后,需要一个完整备份来重新开始日志链
2024-01-22 15:39:53
Python列表排序 list.sort方法和内置函数sorted用法
2022-01-18 01:01:47
python队列原理及实现方法示例
2022-10-08 20:53:09
一文详解JSON.parse和JSON.stringify的用法
2024-04-16 08:45:09
![](https://img.aspxhome.com/file/2023/6/137026_0s.png)
网易2016研发工程师编程题 奖学金(python)
2021-11-21 19:37:54
使用 iframe 获取网页片段的一个好处
2008-12-01 12:37:00
Python有序字典简单实现方法示例
2021-05-05 19:25:58
![](https://img.aspxhome.com/file/2023/6/68496_0s.jpg)
iview实现动态表单和自定义验证时间段重叠
2023-07-02 17:09:28
![](https://img.aspxhome.com/file/2023/6/139956_0s.png)
python使用tkinter实现简单计算器
2021-10-01 00:20:57
PyTorch中topk函数的用法详解
2022-11-08 13:55:52
![](https://img.aspxhome.com/file/2023/3/86183_0s.jpg)
Python NumPy实用函数笔记之allclose
2023-08-24 18:09:12
python使用pandas抽样训练数据中某个类别实例
2021-03-02 02:56:14
原生JS实现的简单轮播图功能【适合新手】
2024-04-27 15:22:44
![](https://img.aspxhome.com/file/2023/3/135503_0s.gif)
Vue.extend实现组件库message组件示例详解
2024-05-09 15:09:26
![](https://img.aspxhome.com/file/2023/4/126614_0s.jpg)
Python3 ffmpeg视频转换工具使用方法解析
2021-07-28 15:00:30
![](https://img.aspxhome.com/file/2023/8/99038_0s.png)