Help us understand the problem. What is going on with this article?

Redisでデータファイルを作って適当に遊ぶ

More than 5 years have passed since last update.

一時的にredis DBのデータを読み書きしたいけどシステムのDBは触りたくないとき.
redis-serverコマンドの引数に-を渡すと設定を標準入力から読むので,以下のようにすれば適当に設定したサーバーを立ち上げられる.設定入力を終えたらctrl-dを押すとサーバーが立ち上がる.

$ redis-server -
port 12345
logfile stdout
dir .
dbfilename test.rdb
save 1 1
# press ctrl-D
# log ...

別プロンプトでDBを触る.

$ redis-cli -p 12345
redis 127.0.0.1:12345> KEYS *
(empty list or set)
redis 127.0.0.1:12345> SET A 1
OK
redis 127.0.0.1:12345> GET A
"1"
yaotti
Qiitaを作っているIncrements株式会社の創業者
http://yaotti.hatenablog.com
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away