vim mysql.sh
#!/bin/bash
host='127.0.0.1'
user='root'
passwd='root'
dbname='test'
test_sql='select count(*) from test'
num=$(mysql -s -h$host -u$user -p$passwd $dbname -e "$test_sql")
echo $num
vim mysql.sh
#!/bin/bash
host='127.0.0.1'
user='root'
passwd='root'
dbname='test'
test_sql='select count(*) from test'
num=$(mysql -s -h$host -u$user -p$passwd $dbname -e "$test_sql")
echo $num
已有 0 条评论