Linux下用密码连接Redis,***总结:在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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值