没办法通过主机名连mysql
Tofloor
poster avatar
male
deepin
2016-09-01 04:14
Author
我原来是在windows下,可以通过主机名访问到mysql,后来我想在deepin下做开发,因为是DHCP,IP可能会变,所以我想让其它人用机器名访问mysql,但结果失败。
ip可以,localhost可以。主机名不行。



Reply Favorite View the author
All Replies
avatar
135******85
deepin
2016-09-01 08:11
#1
能ping说明网络是通的,不能telnet说明端口没开放,多半是防火墙之类的问题。
Reply View the author
avatar
male
deepin
2016-09-01 21:38
#2
https://bbs.deepin.org/post/42936
能ping说明网络是通的,不能telnet说明端口没开放,多半是防火墙之类的问题。 ...

deepin不是没防火墙么?
Reply View the author
avatar
male
deepin
2016-09-01 21:41
#3
用ip正常 ,说明端口是开放的。
Reply View the author
avatar
male
deepin
2016-09-02 01:18
#4
我windows,别的机器(windows)下就可以通过名称来访问我的mysql
而在deepin下就没办法通过名称来访问。只能IP
Reply View the author
avatar
jiuxian
deepin
2016-09-02 16:50
#5
127.0.1.1 ? 127.0.0.1 ? 你是手动在host文件里添加的主机名吗?
Reply View the author
avatar
male
deepin
2016-09-03 03:34
#6
好像自动生成的吧,你看看你们的机器有没有。
Reply View the author
avatar
male
deepin
2016-09-03 04:20
#7
好像127.0.1.1注掉就可以了。
这个应该不是我加的,是装好系统就有的,我根不知道1.1是什么。
Reply View the author
avatar
catbb49294929
deepin
2016-09-03 04:38
#8
主机名不在你hosts里加怎么连接。。。。好歹给个解析才行啊。。。。又不是域名。
Reply View the author
avatar
liyujiang
deepin
2016-09-03 04:49
#9
需要修改/etc/hosts,加入“127.0.0.1    你的主机名”
Reply View the author
avatar
hwang
deepin
2016-09-03 05:02
#10
这因为windows有netbios服务,在局域网中能够通过广播的方式实现本地主机之间的主机名解析,所以可以直接用主机名,但是你是linux,默认是没有这项服务的。据我所知,安装samba会附带这个,启动samba服务器会启动两个服务进程,其中nmbd就是提供netbios的,但是不知道能不能单独启动这个,还没试过
Reply View the author