三不知 cat 了一下 redis 的储存文件(dump.rdb);结果服务器终端瞬间全部乱码!!!
[root@master redis]# cat dump.rdb
#reset //用reset终端复位命令解决问题
dump.rdb 文件是由 Redis 自动生成数据储存的;但是这个文件里面具体的内容格式还真没有深究过。这里做个总结
这里扩展一下如何解析redis的rdb文件
点击查看
PS C:\Users\Administrator\Desktop\fsdownload> pip install rdbtools python-lzf
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting python-lzf
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e3/33/b8f67bbe695ccc39f868ae55378993a7bde1357a0567803a80467c8ce1a4/python-lzf-0.2.4.tar.gz (9.3 kB)
Collecting rdbtools
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/dd/e5/eebb748863d74b7f9d433e359b874d97e830e9d1b3e3d876b91b5cba6b9d/rdbtools-0.1.15.tar.gz (31 kB)
Requirement already satisfied: redis in c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages (from rdbtools) (3.3.2)
Using legacy 'setup.py install' for python-lzf, since package 'wheel' is not installed.
Using legacy 'setup.py install' for rdbtools, since package 'wheel' is not installed.
Installing collected packages: rdbtools, python-lzf
Running setup.py install for rdbtools ... done
Running setup.py install for python-lzf ... done
Successfully installed python-lzf-0.2.4 rdbtools-0.1.15
WARNING: You are using pip version 20.3.3; however, version 21.0.1 is available.
You should consider upgrading via the 'c:\users\administrator\appdata\local\programs\python\python37\python.exe -m pip install --upgrade pip' command.
PS C:\Users\Administrator\Desktop\fsdownload> rdb --command json .\dump.rdb
[{
"xsw":"gogogo"}]
PS C:\Users\Administrator\Desktop\fsdownload>