标签:重启 table 完成后 grant 显示 conf HERE tst roo
报错: 2003 - can‘t connect to MySQL server on ‘192.168.1.108‘(10038)
使用apt-get安装的mysql, 没有修改任何配置. 在虚拟机里 查看数据库,
use mysql; # mysql库里有一个user表 show tables; select user,host from user; # 看到root那一行记录 root对应的host是localhost, 也就是不能远程登录的意思. 需要将其修改成%. update user set host=‘%‘ where user=‘root‘; #表示允许远程其他用户登录
还有一种方法(没有尝试): grant all privileges on *.* to ‘root‘@‘%‘ identififed by ‘密码‘ with grant option; #也是修改登录权限,这个和修改表任选其一
netstat -apn | grep 3306 #显示的如果是127.0.0.1:3306那么就注释/etc/mysql/mysql.conf.d/mysqld.cnf 中的bind-address 127.0.0.1
注释完成后重启mysql.
#重启mysql (Ubuntu系统) /etc/init.d/mysql restart
再使用netstat -apn | grep 3306 查看 如果显示的是 :::3306 就OK了 连接成功!!!
标签:重启 table 完成后 grant 显示 conf HERE tst roo
原文地址:https://www.cnblogs.com/bneglect/p/11475146.html