mysql -uroot -p
输入密码进去
mysql> grant all privileges on *.* to root@'%' identified by 'newpassword' with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
说明:
% 所有的地址
newpassword 配置访问mysql的访问密码