登录到mysql后
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;//password是对应的root密码
flush privileges;