1、mysql -u root -p
2、use mysql
3、GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
4、flush privileges;
5、select host,user from user;