atan
V2EX  ›  问与答

XP下如何修改localhost解析为其他IP

  •  
  •   atan · Oct 29, 2012 · 4997 views
    This topic created in 4944 days ago, the information mentioned may be changed or developed.
    我修改了hosts似乎无效,怎么修改都是指向127.0.0.1,有什么方法可以改变localhost的IP地址吗?
    7 replies    1970-01-01 08:00:00 +08:00
    atan
        1
    atan  
    OP
       Oct 29, 2012
    Win7下修改hosts就可以,XP死活不行~~
    sNullp
        2
    sNullp  
       Oct 29, 2012
    我只是好奇一下为什么要这么做。。
    atan
        3
    atan  
    OP
       Oct 29, 2012
    有个软件,远程连接MYSQL,地址写死了,只能连localhost
    clowwindy
        4
    clowwindy  
       Oct 29, 2012
    ssh -L localhost:3306:localhost:3306 servername
    atan
        5
    atan  
    OP
       Oct 29, 2012
    @clowwindy 谢谢,但是我不是要远程连接,我是连接数据库的信息写在php里的,而且只能写localhost, 但实际上数据库不再本地,而在局域网里的另一台服务器上。
    SAGAN
        6
    SAGAN  
       Oct 29, 2012
    那你写个socket程序监听本地3306端口转发到别的机器吧 = =
    clowwindy
        7
    clowwindy  
       Oct 29, 2012
    @atan ssh -L 透明端口转发
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4614 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 01:02 · PVG 09:02 · LAX 18:02 · JFK 21:02
    ♥ Do have faith in what you're doing.