测试

mysql error:由于目标计算机积极拒绝,无法连接

mysql部署在虚拟机,使用dbForge Studio for Mysql 连接Mysql时,报如下错:

Can't connect to MySql server on '*.*.*.*'(10061);

由于目标计算机积极拒绝,无法连接。 *.*.*.*:3306

 

原因:Mysql 配置文件中绑定了IP,只能由localhost访问

解决:

方式1.更改配置文件 /etc/mysql/my.cnf 中的bind-address=localhost 为 bind-address = 虚拟机实际IP

方式2.当需要远程访问时,直接注释掉 bind-address=localhost

        不过此时在服务器本机通过 mysql -uxxx -pxxx将会拒绝访问,因为默认ip为localhost;本机通过mysql -uxxx -pxxx -h 127.0.0.1 即可访问

posted @ 2015-06-27 23:37  Genter  阅读(5623)  评论(0编辑  收藏  举报

测试