mysqlroot passwd

grant all on *.* to 'root'@'192.168.0.%' identified by 'bloablabar';

 更改用户密码:

update user set password=password("newpassword") where user="root";

 新安数据库设密码:

mysqladmin -uroot password test
原文地址:https://www.cnblogs.com/bass6/p/5858832.html