1、现象
MySQL只能通过localhost和127.0.0.1登录,IP无法登录
2、原因
MySQL默认只能通过localhost或回环地址127.0.0.1登录,要想用IP登录,需要手动放开权限
3、问题解决
①win+R 打开Cmd窗口,进入MySQL安装目录
②登录数据库
mysql -u root -p
输入root的密码
③执行以下命令:
grant all privileges on *.* to '用户名'@'IP地址' identified by '密码';
④.刷新权限
flush privileges;
所有评论(0)