[root@nomo ~]# echo 'select host,user,password from mysql.user' |mysql -uroot -p123456 host user password localhost root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 nomo.amoizt.com.cn root 127.0.0.1 root localhost nomo.amoizt.com.cn % root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
[root@nomo ~]# mysql -uroot -p123456 -e 'select host,user.password from mysql.user' +--------------------+-------------------------------------------+ | host | password | +--------------------+-------------------------------------------+ | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | | nomo.amoizt.com.cn | | | 127.0.0.1 | | | localhost | | | nomo.amoizt.com.cn | | | % | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | +--------------------+-------------------------------------------+ [root@nomo ~]# mysql -uroot -p123456 <<EOF > use mysql; > select host,user,password from user; > EOF host user password localhost root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 nomo.amoizt.com.cn root 127.0.0.1 root localhost nomo.amoizt.com.cn % root *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9
|