美文网首页
memcache安装及python中使用

memcache安装及python中使用

作者: 米斯特_李 | 来源:发表于2018-07-05 14:31 被阅读0次

                                        memcache安装及python中使用

1. yum安装

    1.1 yum -y install memcached

2、验证安装memcached

   memcached-h 可以查看相关信息

可以通过cat /etc/sysconfig/memcached  查看相关配置

OPTIONS 中可以设置参数 比如 "-l 127.0.0.1"

3、启动memcached

memcached -d -u root

4、在python中使用

import memcache

pymem = memcache.Client(['127.0.0.1:11211'],debug=0)

pymem.set("key","hello,memcache!", 100)

pymem.get("key")

相关文章

网友评论

      本文标题:memcache安装及python中使用

      本文链接:https://www.haomeiwen.com/subject/hihpuftx.html