在shell脚本变量中获取受mysql影响的行

时间:2015-09-14 07:24:35

标签: mysql shell

这是我的shell脚本,它调用了一些过程

#!/bin/bash
ip=$1
username=$2
password=$3
user=$4

mysql -h $ip -u $username -p$password << EOF

use myDb;

call clear_user_device("$user");

EOF
echo "device cleared successfully"

我想 - 无论行是否受影响,向用户显示输出。我尝试了mysql_affected_rows(),row_count()等但它无法正常工作。

请帮忙

0 个答案:

没有答案