echo "grant all on *.* to 'root'@'localhost' identified by 'newpass';" | mysql -uroot echo "grant all on *.* to 'root'@'%' identified by 'newpass';" | mysql -uroot -pnewpass --phpfensi.com
二、方法二
1)停止mysql服務(wù)
2)跳過權(quán)限檢查啟動 mysql /usr/bin/mysqld_safe --skip-grant-tables &