Shell-获取Mysql查询返回值
获取单个值
1 | export MYSQL_PWD=123abc!!! |
获取多个值
1 | mysql -uroot -pmysqlroot -Dmmmtest -e "select 'aa',count(1) from aa" --skip-column-names|while read a b |
1 | export MYSQL_PWD=123abc!!! |
1 | mysql -uroot -pmysqlroot -Dmmmtest -e "select 'aa',count(1) from aa" --skip-column-names|while read a b |