GRANT
ALL
PRIVILEGES
ON
*.*
TO
'root'
@
'%'
IDENTIFIED
BY
'123456'
WITH
GRANT
OPTION
;
GRANT
ALL
PRIVILEGES
ON
*.*
TO
'root'
@
'192.168.120.110'
IDENTIFIED
BY
'123456'
WITH
GRANT
OPTION
;
说明:root是登陆数据库的用户,123456是登陆数据库的密码,*就是意味着任何来源任何主机反正就是权限很大的样子。
最后配置好权限之后不应该忘记刷新使之生效flush
privileges; //
select host,user from user; //查看允许登录的用户