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

  1. 云栖社区>
  2. 博客>
  3. 正文

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

suboysugar 2015-07-06 18:58:00 浏览687
展开阅读全文

[root@iZ254lfyd6nZ ~]# cd /
[root@iZ254lfyd6nZ /]# ls
bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
[root@iZ254lfyd6nZ /]# cd usr
[root@iZ254lfyd6nZ usr]# ls
bin  etc  games  include  lib  lib64  libexec  local  sbin  share  src  tmp
[root@iZ254lfyd6nZ usr]# cd local
[root@iZ254lfyd6nZ local]# ls
aegis  bin  etc  games  include  lib  lib64  libexec  redis  redis-2.8.12.tar.gz  sbin  share  src
[root@iZ254lfyd6nZ local]# cd redis
[root@iZ254lfyd6nZ redis]# ls
00-RELEASENOTES  CONTRIBUTING  deps      INSTALL   MANIFESTO  redis.conf  runtest-sentinel  src    utils
BUGS             COPYING       dump.rdb  Makefile  README     runtest     sentinel.conf     tests
[root@iZ254lfyd6nZ redis]# cd src
[root@iZ254lfyd6nZ 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

[root@iZ254lfyd6nZ 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.

 

如何联系我:【万里虎】www.bravetiger.cn 【QQ】3396726884 (咨询问题100元起,帮助解决问题500元起) 【博客】http://www.cnblogs.com/kenshinobiy/

网友评论

登录后评论
0/500
评论
suboysugar
+ 关注