转自:http://my.oschina.net/cniiliuqi/blog/67423
1、Example
$redis->pconnect('127.0.0.1', 6379); $redis->pconnect('127.0.0.1'); // port 6379 by default - same connection like before. $redis->pconnect('127.0.0.1', 6379, 2.5); // 2.5 sec timeout and would be another connection than the two before. $redis->pconnect('127.0.0.1', 6379, 2.5, 'x'); // x is sent as persistent_id and would be another connection the the three before. $redis->pconnect('/tmp/redis.sock'); // unix domain socket - would be another connection than the four before.
2、AUTH password http://redis.readthedocs.org/en/latest/connection/auth.html
写道
# 设置密码
redis> CONFIG SET requirepass secret_password # 将密码设置为 secret_password
OK
redis> QUIT # 退出再连接,让新密码对客户端生效
[huangz@mypad]$ redis
redis> PING # 未验证密码,操作被拒绝
(error) ERR operation not permitted
redis> AUTH wrong_password_testing # 尝试输入错误的密码
(error) ERR invalid password
redis> AUTH secret_password # 输入正确的密码
OK
redis> PING # 密码验证成功,可以正常操作命令了
PONG
# 清空密码
redis> CONFIG SET requirepass "" # 通过将密码设为空字符来清空密码
OK
redis> QUIT
$ redis # 重新进入客户端
redis> PING # 执行命令不再需要密码,清空密码操作成功
PONG
redis> CONFIG SET requirepass secret_password # 将密码设置为 secret_password
OK
redis> QUIT # 退出再连接,让新密码对客户端生效
[huangz@mypad]$ redis
redis> PING # 未验证密码,操作被拒绝
(error) ERR operation not permitted
redis> AUTH wrong_password_testing # 尝试输入错误的密码
(error) ERR invalid password
redis> AUTH secret_password # 输入正确的密码
OK
redis> PING # 密码验证成功,可以正常操作命令了
PONG
# 清空密码
redis> CONFIG SET requirepass "" # 通过将密码设为空字符来清空密码
OK
redis> QUIT
$ redis # 重新进入客户端
redis> PING # 执行命令不再需要密码,清空密码操作成功
PONG
3、Redis的PHP字符串实例 http://www.yiibai.com/redis/redis_php.html
<?php //Connecting to Redis server on localhost $redis = new Redis(); $redis->connect('127.0.0.1', 6379); echo "Connection to server sucessfully"; //set the data in redis string $redis->set("tutorial-name", "Redis tutorial"); // Get the stored data and print it echo "Stored string in redis:: " + jedis.get("tutorial-name"); ?>
相关推荐
赠送jar包:flink-connector-redis_2.10-1.1.5.jar; 赠送原API文档:flink-connector-redis_2.10-1.1.5-javadoc.jar; 赠送源代码:flink-connector-redis_2.10-1.1.5-sources.jar; 赠送Maven依赖信息文件:flink-...
php队列+php-redis队列+php-redis扩展,php入队出队,redis入队出队以及其php .dll扩展
tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-redis-session-manager-1.2-tomcat-7-java-7tomcat-...
压缩文件包括tomcat-redis-session-manager-master-2.0.0.jar、jedis-2.7.3.jar、commons-pool2-2.3.jar三个jar包使用方法请参照https://github.com/jcoleman/tomcat-redis-session-manager。apache-tomcat-8.5.33....
赠送jar包:spring-data-redis-2.5.5.jar; 赠送原API文档:spring-data-redis-2.5.5-javadoc.jar; 赠送源代码:spring-data-redis-2.5.5-sources.jar; 赠送Maven依赖信息文件:spring-data-redis-2.5.5.pom; ...
jizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-redis-mqjizq-...
Spring-data-redis 1.7.6 & source源码
spring-data-redis-2.0.0.M1.jar
spring-data-redis-1.8.1.RELEASE-sources.jar(spring-data-redis-1.8.1.RELEASE-sources.jar()
tomcat-redis-session-manager-2.0.0.jar
commons-pool2-2.3.jar,jedis-2.8.0.jar,spring-data-redis-1.6.0.RELEASE.jar,spring-session-1.1.1.RELEASE.jar,Spring-data-redis(Version 1.6.0.RC1)中文版.pdf
Tomcat8亲测可用 tomcat-redis-session-manager的jar包 修改了tomcat-redis-session-manager源码进行的编译生成的jar包
所需的tomcat-redis-session-manager所有的jar包下载。测试环境JDK1.8,Tomact8
使用tomcat-redis-session-manager进行统一session管理所需jar包,包括tomcat6-jdk6、tomcat7-jdk7、tomcat8-jdk8
spring-data-redis-1.4.1.RELEASE
tomcat-redis-session-manager-2.0.0.jar jedis-2.5.2.jar commons-pool2-2.2.jar 2.修改 conf 目录下的 context.xml 文件 host="localhost" port="6379" database="0" maxInactiveInterval="60" /> ...
spring-data-redis-1.6.2.RELEASE.jar,官网文档,免费提供,亲测可用
开源项目-go-redis-redis.zip,go-redis v3 supports Redis Cluster