How to export all keys and values from memcached w

2019-02-02 00:46发布

I would like to export all keys and values from a memcached server, using python-memcache. There is no such function in that module. How to do it then?

Perhaps something more complicated involving the "socket" module would be needed.

7条回答
我只想做你的唯一
2楼-- · 2019-02-02 01:19

You're looking for the 'flush_all' memcache command: http://code.google.com/p/memcached/wiki/NewCommands#flush_all

With python-memcached, it looks something like this:

>>> import memcache
>>> c = memcache.Client(('127.0.0.1:11211',))
>>> c.flush_all()
查看更多
登录 后发表回答