mysql数据库使root可以远程访问:

 mysql数据库使root可以远程访问:

mysql -u root                                                         #进入mysql管理
use mysql;                                                            #使用mysql数据库
update user set host = '%' where user = 'root' and host='localhost';  #修改登陆主机为任意位置%
grant all privileges  on *.* to root@'%' identified by "key000000";   #赋予所有权限并设置密码
delete from user where host != "%";                                   #删除所有其他用户,如匿名用户
flush privileges;                                                     #刷新权限

猜你喜欢

转载自peak.iteye.com/blog/2251036