- redis-cli -h 127.0.0.1 -p 6379 shutdown //停止服务
- ./redis-server redis_6379.config //启动服务
nodejs添加redis密码验证写法
var redis = require('redis'),
RDS_PORT = 6379, //端口号
RDS_HOST = '127.0.1.1', //服务器IP
RDS_PWD = 'porschev',
RDS_OPTS = {auth_pass:RDS_PWD
}, //设置项
client = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS); client.on('ready',function(res){ console.log('ready');
});