这个例子演示了如何在shell脚本中执行多个sql来操作数据库表。

#! /bin/sh
USER_HOME=/home/`whoami`
. /etc/profile
if [ -f ${USER_HOME}/.bash_profile ];
then
        . ${USER_HOME}/.bash_profile
fi

mysql -h 20.1.4.89 -P 8911 -ujifei30 -pNapnUszJD -Dtpssprod <<EOF
select table_name from information_schema.tables
 where table_schema = 'TPSSPROD';
select now();
exit
EOF

 

相关文章:

  • 2021-12-04
  • 2021-12-28
  • 2021-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-05-17
相关资源
相似解决方案