国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

redis坑

2019-11-06 06:44:47
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

1、密碼問(wèn)題(默認(rèn)沒(méi)有密碼) ERR Client sent AUTH, but no passWord is set Redis 127.0.0.1:6379> CONFIG SET requirepass “123456” OK redis 127.0.0.1:6379> AUTH 123456 Ok 或者在redis的配置文件redis.conf中打開(kāi)requirepass注釋 2、版本問(wèn)題 ERR Unsupported CONFIG parameter: notify-keyspace-events 將Redis-2.4.5,更新到redis-2.8.12

3、非本地連接問(wèn)題 redis默認(rèn)只能localhost登錄 在redis的配置文件redis.conf中,找到bind 127.0.0.1,替換成0.0.0.0

linux下安裝redis 1、先通過(guò)yum安裝gcc : yum install -y gcc g++ gcc-c++ make 2、執(zhí)行make 對(duì)Redis解壓后文件進(jìn)行編譯 tar -zxzf redis-3.0.7.tar.gz cd redis-3.0.7 make 3、編譯成功后,進(jìn)入src文件夾,執(zhí)行make install進(jìn)行Redis安裝 redis-server、redis-cli、redis-benchmark、 redis-check-aof、redis-check-dump、redis-sentinel

啟動(dòng)服務(wù)端:[root@mcs-slave-2 redis-stable]# ./src/redis-server redis.conf 調(diào)用客戶端:[root@mcs-slave-2 redis-stable]# ./src/redis-cli 127.0.0.1:6379> CONFIG SET requirepass “123456” OK

docker下安裝redis 下載redis鏡像:docker pull redis 啟動(dòng):sudo docker run -d –name redis -p 6379:6379 redis //安裝redis client yuminstallredis?tools//啟動(dòng)redis?cli redis-cli -h localhost -p 6379 $ redis-cli -h 127.0.0.1 -p 6379 -a myPassword //redis-cli localhost:6379> set hello world localhost:6379> get hello “world”

java調(diào)用jedis

@Beanpublic JedisConnectionFactory connectionFactory(){ JedisConnectionFactory conn = new JedisConnectionFactory(); conn.setDatabase(3); conn.setHostName("127.0.0.1"); conn.setPassword("123456"); conn.setPort(6379); conn.setTimeout(3000); return conn;}
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 青浦区| 聊城市| 临泉县| 临夏县| 天气| 化隆| 西青区| 剑河县| 浏阳市| 全南县| 昭平县| 怀安县| 南京市| 黎城县| 东乌珠穆沁旗| 治多县| 都匀市| 尚义县| 巴青县| 方正县| 池州市| 封丘县| 方城县| 元氏县| 雅安市| 宾阳县| 长春市| 泾川县| 缙云县| 洪雅县| 赞皇县| 肃宁县| 济南市| 贞丰县| 秀山| 青河县| 泸定县| 闽清县| 家居| 翁源县| 镇江市|