***总结:在linux下连接redis并进行命令行操作(设置redis密码)

Posted piwefei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了***总结:在linux下连接redis并进行命令行操作(设置redis密码)相关的知识,希望对你有一定的参考价值。

[[email protected] ~]# cd /
[[email protected] /]# ls
bin boot dev etc home lib lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var
[[email protected] /]# cd usr
[[email protected] usr]# ls
bin etc games include lib lib64 libexec local sbin share src tmp
[[email protected] usr]# cd local
[[email protected] local]# ls
aegis bin etc games include lib lib64 libexec redis redis-2.8.12.tar.gz sbin share src
[[email protected] local]# cd redis
[[email protected] redis]# ls
00-RELEASENOTES CONTRIBUTING deps INSTALL MANIFESTO redis.conf runtest-sentinel src utils
BUGS COPYING dump.rdb Makefile README runtest sentinel.conf tests
[[email protected] redis]# cd src
[[email protected] src]# ls
adlist.c aof.o db.o intset.h mkreleasehdr.sh rand.c redis-check-dump replication.o sha1.h t_list.o ziplist.o
adlist.h asciilogo.h debug.c intset.o multi.c rand.h redis-check-dump.c rio.c sha1.o t_set.c zipmap.c
adlist.o bio.c debug.o lzf_c.c multi.o rand.o redis-check-dump.o rio.h slowlog.c t_set.o zipmap.h
ae.c bio.h dict.c lzf_c.o networking.c rdb.c redis-cli rio.o slowlog.h t_string.c zipmap.o
ae_epoll.c bio.o dict.h lzf_d.c networking.o rdb.h redis-cli.c scripting.c slowlog.o t_string.o zmalloc.c
ae_evport.c bitops.c dict.o lzf_d.o notify.c rdb.o redis-cli.o scripting.o solarisfixes.h t_zset.c zmalloc.h
ae.h bitops.o endianconv.c lzf.h notify.o redisassert.h redis.h sds.c sort.c t_zset.o zmalloc.o
ae_kqueue.c config.c endianconv.h lzfP.h object.c redis-benchmark redis.o sds.h sort.o util.c
ae.o config.h endianconv.o Makefile object.o redis-benchmark.c redis-sentinel sds.o syncio.c util.h
ae_select.c config.o fmacros.h Makefile.dep pqsort.c redis-benchmark.o redis-server sentinel.c syncio.o util.o
anet.c crc64.c help.h memtest.c pqsort.h redis.c release.c sentinel.o testhelp.h valgrind.sup
anet.h crc64.h hyperloglog.c memtest.o pqsort.o redis-check-aof release.h setproctitle.c t_hash.c version.h
anet.o crc64.o hyperloglog.o migrate.c pubsub.c redis-check-aof.c release.o setproctitle.o t_hash.o ziplist.c
aof.c db.c intset.c migrate.o pubsub.o redis-check-aof.o replication.c sha1.c t_list.c ziplist.h

[[email protected] src]# ./redis-cli
127.0.0.1:6379> get name
"tanglei1234"
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) ""
127.0.0.1:6379> config set requirepass newpsw
OK
127.0.0.1:6379> config get requirepass
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth newpsw
OK
127.0.0.1:6379> get name
"tanglei1234"
127.0.0.1:6379>
Connection closed by foreign host.

以上是关于***总结:在linux下连接redis并进行命令行操作(设置redis密码)的主要内容,如果未能解决你的问题,请参考以下文章

Redis学习与总结

LInux 下PHP环境配置 Redis 总结

redis常用命令

Linux安装redis并部署,使用远程工具连接。

如何关闭redis服务

Linux无法远程连接Redis?