Home>

I am learning redis on mac
I opened the dump.rdb file made with redis in Notepad, but the key and value are not displayed and only "dump.rdb" is displayed
On the client side, shoutdown was executed to save the data, and when the server was started up again and key * was executed, the previous data was properly left
How can I view the dump.rdb file in Notepad (any other app)

Additional
1) After checking the update date and file size of dump.rdb file with redis stopped, start redis and write some data, then stop redis and update file date and size of dump.rdb Whether has changed

>The update date and size have changed

2) Whether the rdb file write location is specified in the conf file

>Sorry, I didn't understand the meaning of "specify the write location in the conf file", but dump.rdb is in /Desktop/redis_lessons/dump.rdb

3) redis version

> It is 5.0.7

  • Answer # 1

    Thank you for adding.

    Append 1

      

    Update date and size have changed

    The rdb file has been updated, so I think that it is being written to, but this file is not a text file. I think not.
    Please use redis-cli or GUI tool to check the data. If you really want to open it with a text editor, why not try using a free text editor other than Notepad?

    A simple command to check data with redis-cli iskeys.
    Specifying * (asterisk) as shown below will output all data.

    >keys *

    There seem to be some GUI tools.

    Redis Desktop Manager

    medis

    Appendix 2

      

    I'm sorry, I didn't understand the meaning of "specify the write location in the conf file".
      dump.rdb is located at /Desktop/redis_lessons/dump.rdb

    I think the

    conf file is probably in "/usr/local/etc/redis.conf", but I don't understand it because I don't have a mac environment.
    If redis.conf is there, open it with a text editor and check the values ​​of the setting items "dbfilename" and "dir".
    dir points to the rdb file output directory.

    Appendix 3

      

    It's 5.0.7

    The link below is the default conf contents of 5.0.

    The self documented redis.conf for Redis 5.0.

    By default,diris the current directory, so if you are running redis-server with/Desktop/redis_lessons,dump.rdbis output.

    # The filename where to dump the DB
    dbfilename dump.rdb
    # The working directory.
    #
    # The DB will be written inside this directory, with the filename specified
    # above using the 'dbfilename' configuration directive.
    #
    # The Append Only File will also be created inside this directory.
    #
    # Note that you must specify a directory here, not a file name.
    dir ./

Trends