当前位置:网站首页>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
边栏推荐
猜你喜欢

Ali Ermi: Without accept, can a TCP connection be established?

PMP daily practice | didn't lost a 8.9 (including agile + multi-select)

Prometheus Operator 自定义监控添加redis explorer

Acrel5000web能耗系统在某学院的应用-Susie 周

Word第一页空白页怎么删除?删除Word第一页空白页方法教程

线性表的定义和基本操作

蓝牙模块的分类和对应的属性特点
![[corctf 2022] section](/img/03/ee1ead55805a2ac690ec79c675c3e6.png)
[corctf 2022] section

Transformer如何用于3D视觉?阿联酋MBZUAI最新《3D视觉Transformers处理》综述,涵盖100+种方法

LoRa Basics无线通信技术和应用案例详解
随机推荐
安科瑞无线物联网智能电表ADW300指导性技术要求-Susie 周
Don't tell me to play, I'm taking the PMP exam: what you need to know about choosing an institution for the PMP exam
Interviewer: How to deal with Redis big key?
hdu 3341 Lost's revenge(dp+Ac自动机)
URL Protocol 网页打开应用程序
PMP每日一练 | 考试不迷路-8.9(包含敏捷+多选)
【深度学习】pix2pix GAN理论及代码实现
微软word怎么转换成pdf文件?微软word转换为pdf格式的方法
威纶通触摸屏制作自定义弹出窗口的具体方法(3种)
获取数组最后一项别再用array.length-1了
一千以内的水仙花数
[corctf 2022] section
LoRa Basics无线通信技术和应用案例详解
UE4_定序器控制蓝图对象
没有 accept,我可以建立 TCP 连接吗?
获取一段程序运行的时间
Definition and Basic Operations of Linear Tables
leetcode 二叉树的公共近祖先
基于Docker构建MySQL主从复制数据库
39. 组合总和 && 40. 组合总和2 && 216. 组合总和3