MySQL开启远程登录

你会不会也像我一样,在使用Navicat for MySQL远程连接mysql时遇到 10038错误。这是因为mysql默认是不允许远程连接的,下面我来解释一种非常简洁的方法,来解决这个问题。

错误信息


一、授权

进入mysql 执行以下语句进行授权操作

grant all privileges on *.*  to  'root'@'%'  identified by 'yourpassword'  with grant option;

flush privileges;

yourpassword 处填写你的密码

二、修改配置文件

由于本人所使用的是ubuntu系统,所以配置文件在/etc/mysql/my.cnf下(其他系统下的大致如此 一般都是my.cnf)

找到 bind-address = 127.0.0.1 这一行
改为 bind-address = 0.0.0.0 即可

成功
就两步 大功告成。

猜你喜欢

转载自blog.csdn.net/qq_33472557/article/details/77419235