1、运行程序链接hiredis出现错误
error while loading shared libraries:
libhiredis.so.0.13: cannot open shared object file: No such file or directory
birdbird@birdbird-virtual-machine:~$ sudo su
[sudo] birdbird 的密码:
root@birdbird-virtual-machine:/home/birdbird# vi /etc/ld.so.conf
然后加入/usr/local/lib 保存退出。
root@birdbird-virtual-machine:/home/birdbird# /sbin/ldconfig
再去运行程序就好啦~
2、config set stop-writes-on-bgsave-error no //执行这个命令
127.0.0.1:6379> setex aa 10 aa
(error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk.
Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
OK
127.0.0.1:6379> setex aa 10 aa
OK
127.0.0.1:6379> ttl aa
(integer) 6
3、redis get中文乱码
127.0.0.1:6379> set 性别 男
OK
127.0.0.1:6379> get 性别
"\xe7\x94\xb7"
127.0.0.1:6379> exit
root@birdbird-virtual-machine:/home/birdbird# redis-cli --raw
127.0.0.1:6379> get 性别
男
|