sh中执行sql脚本
程序员文章站
2022-07-13 08:04:36
...
clear.sh
内容如下:
sql1="delete from dtable1;"
sql2="delete from dtable2;"
clear_sql=${sql1}${sql2}
mysql -udbkfa -pdbkfa -h192.168.106.1 -P3306 dbkfa -e "${clear_sql}"
上传到linux下,赋权限 然后执行 ./clear.sh
内容如下:
sql1="delete from dtable1;"
sql2="delete from dtable2;"
clear_sql=${sql1}${sql2}
mysql -udbkfa -pdbkfa -h192.168.106.1 -P3306 dbkfa -e "${clear_sql}"
上传到linux下,赋权限 然后执行 ./clear.sh
推荐阅读