shell脚本连接数据库

#!/bin/sh
HOST=192.168.5.40
USER=abc
PASS=123456
QUERY=`mysql -h$HOST -u$USER -p$PASS << EOF
use testdb;
select * from person where name='LiMing';
exit
EOF`
echo $QUERY

猜你喜欢

转载自287746074.iteye.com/blog/2346044