远程访问VMware虚拟机Ubuntu的mysql

来源:互联网 发布:php拆分gif 编辑:程序博客网 时间:2024/04/29 21:04

1, 修改/etc/mysql/my.cnf文件中的

bind_address为系统的IP地址

将mysql数据库中user标的记录改一下,

select host, user from user;

update user set host='%' where host='127.0.0.1' and user='root';


flush privileges;


2.重新mysql服务。

可以访问虚拟机中的mysql数据库了,如果防火墙开着,修改一下就行。


可以telnet 虚拟机中系统IP  3306

检测是否可以访问3306