问题一:can’t connect to mysql server on ‘192.168.xxx.xxx’(10061)
解决:
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
bind-address项绑定了登陆的IP,所以需要注释掉即可
然后重启mysql
service mysql restart
问题二:1130-host ‘’ is not allowde to connect to this mysql server
解决:
1、连接服务器: mysql -u root -p
2、看当前所有数据库:show databases;
3、进入mysql数据库:use mysql;
4、查看mysql数据库中所有的表:show tables;
5、查看user表中的数据:select Host, User,Password from user;
6、修改user表中的Host:update user set Host=’%’ where User=‘root’;
7、最后刷新一下:flush privileges;