# 查找redis命令的路徑
find / -name redis-cli
[root@t-enter ~]# find / -name redis-cli
/usr/local/bin/redis-cli
/usr/local/redis-5.0.5/src/redis-cli
redis登錄命令
redis-cli -p 6379 -a root123 # 使用密碼端口登錄命令 redis-cli # 無密碼端口登錄命令
redis-cli -h host -p port -a password # 在遠程登錄redis
示例
使用密碼端口登錄命令
[root@localhost src]# redis-cli -p 6379 -a root123 Warning: Using a password with '-a' option on the command line interface may not be safe. 127.0.0.1:6379>
無密碼端口登錄命令
[root@t-enter ~]# redis-cli 127.0.0.1:6379>
遠程登錄redis命令
#redis-cli -h 127.0.0.1 -p 6379 -a "mypassword" redis 127.0.0.1:6379>