首先要啟動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 ...................
.測試
加入不小心清空了數(shù)據(jù):
打開appendonly.aof 文件,將flushall命令刪除掉,并將這個文件放到redis根目錄下:
根目錄下輸入命令啟動redis服務(wù)器,要使用如下命令啟動,不然配置文件不會生效:
redis-server.exe redis.windows.conf
通過命令keys *,即可查看恢復(fù)的數(shù)據(jù)
到此這篇關(guān)于window環(huán)境redis通過AOF恢復(fù)數(shù)據(jù)的方法的文章就介紹到這了,更多相關(guān)redis通過AOF恢復(fù)數(shù)據(jù)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!