shell script to connect to database

#!/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

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326798934&siteId=291194637