redis-cli -h 127.0.0.1 -p 6379 -a xxxxxx -n 1
参数解释:
-h <hostname> Server hostname (default: 127.0.0.1). 指定ip
-p <port> Server port (default: 6379).指定端口,默认是6379
-a <password> Password to use when connecting to the server. 连接密码
-n <db> Database number.指定的数据库