window環(huán)境redis通過(guò)AOF恢復(fù)數(shù)據(jù)的方法
首先要啟動(dòng)AOF持久化配置,在redis.windows-server.conf配置文件中做出如下更改
................ appendonly yes # The name of the append only file (default: "appendonly.aof") appendfilename "appendonly.aof" ..................................... # appendfsync always appendfsync everysec # appendfsync no ...................
.測(cè)試
加入不小心清空了數(shù)據(jù):
打開appendonly.aof 文件,將flushall命令刪除掉,并將這個(gè)文件放到redis根目錄下:
根目錄下輸入命令啟動(dòng)redis服務(wù)器,要使用如下命令啟動(dòng),不然配置文件不會(huì)生效:
redis-server.exe redis.windows.conf
通過(guò)命令keys *,即可查看恢復(fù)的數(shù)據(jù)
到此這篇關(guān)于window環(huán)境redis通過(guò)AOF恢復(fù)數(shù)據(jù)的方法的文章就介紹到這了,更多相關(guān)redis通過(guò)AOF恢復(fù)數(shù)據(jù)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
redis中使用java腳本實(shí)現(xiàn)分布式鎖
這篇文章主要介紹了redis中使用java腳本實(shí)現(xiàn)分布式鎖,本文同時(shí)講解了java腳本和lua腳本實(shí)現(xiàn)分布式鎖,需要的朋友可以參考下2015-01-01Redis實(shí)現(xiàn)分布式鎖的幾種方法總結(jié)
這篇文章主要介紹了Redis實(shí)現(xiàn)分布式鎖的幾種方法總結(jié)的相關(guān)資料, Redis實(shí)現(xiàn)與Zookeeper實(shí)現(xiàn)和數(shù)據(jù)庫(kù)實(shí)現(xiàn),需要的朋友可以參考下2017-07-07Redis報(bào)錯(cuò):Could not create server TCP 
這篇文章主要介紹了Redis報(bào)錯(cuò):Could not create server TCP listening socket 127.0.0.1:6379: bind:解決方法,是安裝與啟動(dòng)Redis過(guò)程中比較常見的問(wèn)題,需要的朋友可以參考下2023-06-06