今天想看看redis,试了一下,后台启动redis-server 运行redis-cli:
然后再停止服务器的时候,出现了保存不了的报错:
User requested shutdown...
16454:M 22 Mar 23:13:53.035 * Saving the final RDB snapshot before exiting.
16454:M 22 Mar 23:13:53.035 # Failed opening the RDB file dump.rdb (in server root dir /usr/local) for saving: Permission denied
16454:M 22 Mar 23:13:53.035 # Error trying to save the DB, can't exit.
百度之,发现多得是说要改配置文件,找不到,继续百度,查到可以用命令改,所以又进去,在客户端运行:
config set dir "/home/user/**"
要设置到有权限的地方【。。。】
之后便看到在该目录下出现了dump.rdb文件,正常。
有的说,末尾斜杠不能少,据测,没有斜杠可行。