[root@bogon ~]# redis-cli -h 127.0.0.1 -p 6379 -a "123456"
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6379> PING
PONG
1.Redis登录不需要密码时bogon:~ wangjianwen$ redis-cli127.0.0.1:6379> pingPONG127.0.0.1:6379> 需要密码时-a 后输入的即为redis密码;远程登录redis也是下边的方式。[root@bogon ~]# redis-cli -h 127.0.0.1 -p 6379 -a "123456"Warning: Using a password with '-a' or '-u' option on