# 查找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>