#!/bin/sh
mysql -h10.10.10.10 -uroot -p123456 -e"
#use centain database
use finereport;
# close sage model for update
SET SQL_SAFE_UPDATES = 0;
#for area get
update APP_ALL_PLOT_AREA_FACT
set UpdateTime = '2022-01-01 17:53:34'
where UpdateTime = '2021-12-31 01:00:00' ;
#for left core
update APP_ALL_HZ_GOAL_FACT
set UpdateTime = '2022-01-01 17:53:34'
where UpdateTime = '2021-12-31 18:34:07'
#ps: have a Quotation marks blow
"

本文提供了一个使用Shell脚本执行MySQL数据库更新操作的例子。该脚本连接到指定的数据库,并更新了两个表中特定记录的时间戳。
702

被折叠的 条评论
为什么被折叠?



