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服务
2)跳过权限检查启动 mysql /usr/bin/mysqld_safe --skip-grant-tables &