redis(五)-redis.conf

1、命令

    1.1 设置conf中的键值。

192.168.16.128:6379> config set requirepass xxxx
OK

    设置后,登陆时序输入验证(如果redis重启,该密码将被重置):

[root@www redis-3.0.2]# redis-cli -h 192.168.16.128 -p 6379 -a xxxx
192.168.16.128:6379> config get requirepass
1) "requirepass"
2) "xxxx"

 

1、databases 16

     一个redis进程,打开了不止一个数据库,默认打开了16个数据库,从0到15编号。

# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16

 2、port 6379

   客户端连接的端口,也是服务端侦听客户端连接的端口。每个客户端实例,都将再此端口上建立tcp长连接。

# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值