了解到redis没有windows的官方支持,所以在vmbox中的ubuntu装了redis#在ubuntu中

#搜索redis相关软件信息
apt-cache search ^redis #不清楚为什么不加正则符号出现一些毫不相关的,比如下面
#bird-bgp - Internet Routing Daemon [transitional package]
#安装redis客户端
apt-get install redis-server
#修改redis配置文件,否则宿主ip会被拒绝
sudo vi /etc/redis/redis.conf
#注释掉bind 127.0.0.1 这里的bind的意思是绑定当前机器的网卡地址,如果有多个网卡,绑定多个地址,空格分离,不是过滤掉外部ip的意思
#方正我改成 bind 127.0.0.1 192.168.0.122,重启redis失败,bind 192.168.0.122也不行.这个ip是宿主机的ip
#重启redis
sudo /etc/init.d/redis-server restart
#查看端口
netstat -ntlp|grep 6379
#以下是win10操作
#如果telnet不在在控制台添加新功能,测试vmbox端口转发是否成功
telnet 127.0.0.1 6379
#查看是否安装了pip D:\Program Files\Python351\Scripts中是否有pip.exe #如果没有的话,安装http:
//www.cnblogs.com/ptqueen/p/6678015.html pip install redis#安装python的redis模块 #python部分 import redis self.conn = redis.Redis(db=15)
#这里用的是转发端口,默认localhost和6379,没有密码

nat端口转发:

win10下使用python访问vmbox中的redis

 

之前桥接网络一直连不上,路过的大大的帮忙看看,感激不尽

http://bbs.csdn.net/topics/392218076

 

相关文章:

  • 2021-06-18
  • 2021-07-08
  • 2021-06-27
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
猜你喜欢
  • 2022-12-23
  • 2021-08-23
  • 2022-12-23
  • 2021-11-21
  • 2021-07-17
  • 2022-03-04
相关资源
相似解决方案