http://redisdoc.com/ redis 命令参考

    1. $ wget http://download.redis.io/releases/redis-5.0.3.tar.gz
    2. $ tar xzf redis-5.0.3.tar.gz
    3. $ cd redis-5.0.3
    4. $ make

    The binaries that are now compiled are available in the src directory. Run Redis with:

    1. $ src/redis-server

    You can interact with Redis using the built-in client:

    1. $ src/redis-cli
    2. redis> set foo bar
    3. OK
    4. redis> get foo
    5. "bar"

    要想运行远程登录

    1. vi redis.conf
    2. # bind 127.0.0.1 # 注释掉这句
    3. # bind 127.0.0.1
    4. # protected-mode yes # 修改这句
    5. protected-mode no

    远程连接redis : redis/src/redis-cli -h IP -p port

    1. config get requirepass //获取当前密码
    2. config set requirepass "yourpassword"
    3. //设置当前密码,服务重新启动后又会置为默认,即无密码;不建议此种方式

    修改redis.conf配置文件

    1. requirepass yourpassword //此处注意,行前不能有空格

    redis-cli -h 127.0.0.1 -p 6379 -a 123456 //需添加密码参数