标签:character nbsp yum esc get install strong ted escape
安装redis-dump
[root@bogon ~] yum install ruby rubygems ruby-devel //安装rubygems 以及相关包 [root@bogon ~] gem sources -a http://gems.ruby-china.org/ //源,ruby china加入,外面的源不能访问 http://gems.ruby-china.org/ added to sources [root@bogon ~] gem install redis-dump -V redis-dump导出数据 [root@bogon ~] telnet 127.0.0.1 6379 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is ‘^]‘. set test 11 //设置一个值 +OK get test //取值 $2 11 [root@bogon ~] redis-dump -u :passwd@127.0.0.1:6379 >test.json
redis-load还原数据
[root@bogon ~] telnet 127.0.0.1 6379 //telnet到redis
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
flushall //请空所有数据
+OK
keys * //查看已清空
*0
[root@bogon ~] < test.json redis-load //导入数据
[root@bogon ~] telnet 127.0.0.1 6379
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is ‘^]‘.
keys *
*1
$4
test
redis -load 并不能指定端口号 一台多实例 实现不了 redis-loab 指定另一个实例
redis 导入导出redis-load,redis-dump详解
标签:character nbsp yum esc get install strong ted escape
原文地址:http://www.cnblogs.com/lyy3306/p/6368250.html