当前位置:网站首页>linux定时执行sql文件[通俗易懂]
linux定时执行sql文件[通俗易懂]
2022-08-09 19:56:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
创建sh后缀文件: touch test.sh
#!/bin/sh
user=root
pass="123456"
db=test
tablename=ts
mysql -u$user -p$pass -D $db < /usr/local/crontab/sqlFile/test.sql
编辑定时任务 crontab -e
0 4 * * * /bin/sh /usr/local/crontab/test.sh
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/105819.html原文链接:https://javaforall.cn
边栏推荐
猜你喜欢
随机推荐
leetcode二叉搜索树与双向链表
Win11搜索不到文件的解决方法
Week 8 Deep learning for object detection
字节二面问的MySQL,差点没答好
【随笔】致19期的小伙伴们
力扣15-三数之和——HashSet&双指针法
buuctf(探险2)
[Graphic and textual] How to reinstall Win7 system
39. 组合总和 && 40. 组合总和2 && 216. 组合总和3
分数阶混沌系统李雅普指数和分岔图
【NOI模拟赛】防AK题(生成函数,单位根,Pollard-Rho)
Unity_物体自转
Don't use array.length-1 to get the last item of the array
蓝牙模块的分类和对应的属性特点
下秒数据:湖仓一体带来的现代数据堆栈变革开始了
DSPE-PEG-PDP, DSPE-PEG-OPSS, phospholipid-polyethylene glycol-mercaptopyridine reduce the immunogenicity of peptides
CMake 安装升级更高版本
场效应管Mosfet之雷卯Leiditech对应英飞凌Infineon
企业数据打通有什么好处?不同行业怎么解决数据打通难题?
Puyuan Jingdian turned losses into profits in the first half of the year, and high-end products continued to develop!Are you optimistic about "Huawei" in the instrument industry?