直接执行SQL语句:
mysql -h$mysqlHost -u$mysqlUser -p$mysqlPassword -D$mysqlDB -e "<SQL语句1>;<SQL语句1>;"
执行文件中的SQL语句:
1. 先把待执行的mysql命令保存到文件batchfile然后再执行
2. mysql -h $mysqlHost -u$mysqlUser -p$mysqlPassword -D$mysqlDB < batchfile
Powered by: 博客园 Copyright © 2024 Bruce Zhang Powered by .NET 8.0 on Kubernetes