shell脚本连mysql的小技巧

求阙者

关注

阅读 13

2024-03-08

mysql -e ""  2>/dev/null  #把输出的mysql: [Warning] Using a password on the command line interface can be insecure.内容重定向到空,让输出不显示 mysql: [Warning] Using a password on the command line interface can be insecure.

mysql -e ""  2>/dev/null |awk 'NR==2'  #只显示第2行

#TEST="mysql -uxx -hxxxn -pxxx -Pxxx -Dxxx"

#ttt=$($TEST -e "select xxx from xxx where xxx='$xxx'" 2>/dev/null |awk 'NR==2')

精彩评论(0)

0 0 举报