Windows连接虚拟机中的mysql5失败
虚拟机版本为centos6.8,数据库版本为mysql5.6,系统版本为window11。在虚拟机上安装好mysql,并且配置好权限,虚拟机登录正常之后。在windows11上使用工具dbeaver连接mysql失败,报错 CommunicationsException: Communications link failure, The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Mysql连接失败无非以下几个问题:
- Mysql连通性;
- Mysql权限;
- 虚拟机与windows连接性;
- 防火墙;
- Mysql连通性;
在虚拟机上使用一下命令测试mysql连通性
$ mysql -h192.168.177.11 -uroot -pzhou59420 -P3306
如果使用指定ip无法登录,尝试编辑mysql配置文件,修改登录指定ip
$ vi /etc./my.conf
bind-address=192.168.177.11
- Mysql权限;
进入mysql客户端,执行以下命令查看mysql登录权限
mysql>s