此时情绪此时天,无事小神仙
好好生活,平平淡淡每一天

编辑

mysql-shell

Mysql-shell下载链接

https://downloads.mysql.com/archives/shell/

Mysql-shell API链接

https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-features.html

Linux环境shell脚本编码

mysqlsh -h127.0.0.1 -P$3306 -u$root -p$123456 --js --verbose --log-level=@debug3 -e "util.dumpSchemas(['configdb','userdb'],'/home/mjtabu/database/backupSchemas',{'threads':48})" >/home/mjtabu/log/mysqlshell.log 2>&1

动态传参

dbIp="$1"
dbPort="$2"
dbUser="$3"
dbPass="$4"
schemas="$5"
dumpPath="$6"
theadCount="$7"
mysqlshLogPath="$8"
mysqlsh -h$dbIp -P$dbPort -u$dbUser -p$dbPass --js --verbose --log-level=@debug3 -e "util.dumpSchemas($schemas,$dumpPath,{'threads':$theadCount})" >$mysqlshLogPath 2>&1
posted @ 2021-03-04 14:40  踏步  阅读(140)  评论(0编辑  收藏  举报