1.无密码时的访问
redis-cli -h 127.0.0.1 -p
redis 127.0.0.1:>
redis 127.0.0.1:> keys *
1) "myset"
2) "mysortset"
redis 127.0.0.1:> select 1
OK
2.有密码时的访问
redis-cli -h 127.0.0.1 -p -a myRedis
redis 127.0.0.1:> keys *
) "myset"
) "mysortset"
redis 127.0.0.1:> select
OK
redis 127.0.0.1:[]> config get requirepass
) "requirepass"
) "myRedis"
redis 127.0.0.1:[]> config set requirepass my_redis
OK
redis 127.0.0.1:[]> config get requirepass
) "requirepass"
) "my_redis"
设置脚本
E:\redis\redis-2.4.-win32-win64\64bit\redis-cli.exe -a lihonghua_redis