MySQL|设置局域网内可访问

428 阅读1分钟

今天同事要连我本地的mysql数据库,告诉她ip,过了会儿说连不上
于是上网查了一下,最终解决,记录一下,感觉以后还会用到

选择数据库:

use mysql

查看用户

select user, host from user

host修改为任意地址

update user set host='%' where user='root'

root用户授权

grant all privileges on *.* to 'root'@'%' identified by 'root密码' with grant option

清除缓存

flush privileges