分享好友 数据库首页 频道列表

Windows下Redis的安装使用教程

Redis教程  2016-05-26 09:510

本文主要为大家介绍缓存技术中的一种Redis的安装和使用,供大家参考,具体内容如下

一、下载Redis for windows

在网络中搜索Redis fow windows,就可以下载Redis的压缩包。解压包。

Windows下Redis的安装使用教程

会发现其中有32位和64位的不同版本的包,根据需要,使用对应的压缩包即可。

二、解压

我使用的是redisbin_x64.zip的压缩包,将其解压到redis的文件夹中。

Windows下Redis的安装使用教程

解压之后,会发现内容只有一些.exe的文件。到这里,redis就算做好了一半了。

三、配置

在redis下新建一个conf的文件夹,并创建 redis.conf 文本文件。将一下内容复制到配置文件中。

# Redis configuration file example 
 
# By default Redis does not run as a daemon. Use 'yes' if you need it. 
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. 
# 是否以后台进程的形式运行,默认为no 
daemonize no 
 
# When run as a daemon, Redis write a pid file in /var/run/redis.pid by default. 
# You can specify a custom pid file location here. 
# 如果指定以后台形式执行,则需要指定一个pid文件 
pidfile /var/run/redis.pid 
 
# Accept connections on the specified port, default is 6379 
#监听端口号 
port 6379 
 
# If you want you can bind a single interface, if the bind option is not 
# specified all the interfaces will listen for connections. 
# 绑定主机IP 
# bind 127.0.0.1 
 
# Close the connection after a client is idle for N seconds (0 to disable) 
# 客户端空闲超时时间,设置为0,则没有超时。过了空闲时间,则会将客户端的连接关闭 
timeout 300 
 
# Set server verbosity to 'debug' 
# it can be one of: 
# debug (a lot of information, useful for development/testing) 
# notice (moderately verbose, what you want in production probably) 
# warning (only very important / critical messages are logged) 
# 日志记录等级 
loglevel debug 
 
# Specify the log file name. Also 'stdout' can be used to force 
# the demon to log on the standard output. Note that if you use standard 
# output for logging but daemonize, logs will be sent to /dev/null 
# 日志记录方式 
logfile stdout 
 
# 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 
 
################################ SNAPSHOTTING ################################# 
# 
# Save the DB on disk: 
# 
# save <seconds> <changes> 
# 
# Will save the DB if both the given number of seconds and the given 
# number of write operations against the DB occurred. 
# 
# In the example below the behaviour will be to save: 
# after 900 sec (15 min) if at least 1 key changed 
# after 300 sec (5 min) if at least 10 keys changed 
# after 60 sec if at least 10000 keys changed 
save 900 1 
save 300 10 
save 60 10000 
 
# Compress string objects using LZF when dump .rdb databases" alt="Windows下Redis的安装使用教程" />

四、启动redis服务器

使用一下命令启动 redis服务器。

redis-server.exe conf/redis.conf

启动成功之后,你会看到如下的提示:

Windows下Redis的安装使用教程

五、连接redis服务器

使用redis自带的命令,能够连接服务器。

redis-cli.exe -h localhost -p 6379

连接成功之后,会提示以下内容:

Windows下Redis的安装使用教程

这个时候,你就能够使用redis的一下指令操作数据。其他指令,请在网上具体查看一下。

以上就是本文的全部内容,希望对大家的学习有所帮助。

查看更多关于【Redis教程】的文章

展开全文
相关推荐
反对 0
举报 0
评论 0
图文资讯
热门推荐
优选好物
更多热点专题
更多推荐文章
windows下mongodb安装与使用图文教程(整理)
这篇文章主要介绍了windows下mongodb安装与使用图文教程(整理)的相关资料,需要的朋友可以参考下

0评论2016-06-20156

MongoDB快速入门笔记(一)之windows下安装MongoDB方法
MongoDB 是一个基于分布式文件存储的数据库。由 C++ 语言编写。本文重点给大家介绍MongoDB快速入门笔记(一)之windows下安装MongoDB方法,非常不错具有参考借鉴价值,感兴趣的朋友一起看下吧

0评论2016-06-20175

Windows或Linux系统中备份和恢复MongoDB数据的教程
不得不说MongoDB的备份回复操作对比其他数据库来说真的算得上是简便的,无论是在Windows的命令行中或者是Linux里的脚本执行,这里我们就来看一下Windows或Linux系统中备份和恢复MongoDB数据的教程

0评论2016-06-20192

简单解决Windows中MySQL的中文乱码与服务启动问题
这篇文章主要介绍了Windows中MySQL的中文乱码与服务启动问题,如果程序没有特殊需要则建议MySQL尽量默认设为UTF-8格式编码,需要的朋友可以参考下

0评论2016-05-18145

windows下MySQL 5.7.3.0安装配置图解教程(安装版)
这篇文章主要介绍了windows下MySQL 5.7.3.0安装配置图解教程(安装版),需要的朋友可以参考下

0评论2016-05-18227

Windows下MySQL 5.6安装及配置详细图解(大图版)
这篇文章主要介绍了Windows下MySQL 5.6安装及配置详细图解(大图版),需要的朋友可以参考下

0评论2016-05-18116

Windows Server 2003下修改MySQL 5.5数据库data目录
这篇文章主要介绍了Windows Server 2003下修改MySQL 5.5数据库data目录,需要的朋友可以参考下

0评论2016-05-18108

Windows2012配置SQLServer2014AlwaysOn的图解
SQLserver 2014 AlwaysOn增强了原有的数据库镜像功能,使得先前的单一数据库故障转移变成以组(多个数据)为单位的故障转移。接下来通过本文给大家介绍Windows2012配置SQLServer2014AlwaysOn的方法,感兴趣的朋友一起学习吧

0评论2016-05-18121

Windows下编写批处理脚本来启动和重置Oracle数据库
这篇文章主要介绍了Windows下编写cmd脚本来对Oracle数据库执行启动和重置的方法,只需在bat文件中保存cmd shell之后就可以双击使用,简单粗暴,需要的朋友可以参考下

0评论2016-05-18163

windows下oracle 11g r2 安装过程与卸载详细图解
这篇文章主要介绍了windows下oracle 11g r2 安装过程与卸载详细图解,需要的朋友可以参考下

0评论2016-05-18161

通过Windows批处理命令执行SQL Server数据库备份
这篇文章主要介绍了通过Windows批处理命令执行SQL Server数据库备份的相关资料,需要的朋友可以参考下

0评论2016-04-28214

windows环境下Redis+Spring缓存实例讲解
这篇文章主要为大家详细介绍了windows环境下Redis+Spring缓存实例教程,感兴趣的小伙伴们可以参考一下

0评论2016-04-27193

mysql忘记密码怎么办(windows linux)
本文给大家介绍windows系统和linux系统下mysql忘记密码怎么办的相关资料,本文给出了合理的解决方案,非常好用,需要的朋友参考下

0评论2015-11-26111

windows下如何安装和启动MySQL
本篇文章主要给大家介绍windows下如何安装和启动MySQL,需要的朋友跟着小编一起来学习啦

0评论2015-11-1299

windows环境中mysql忘记root密码的解决方法详解
本篇文章是对windows环境中mysql忘记root密码的解决方法进行了详细的分析介绍,需要的朋友参考下

0评论2015-11-0971

windows环境下Mysql中文乱码问题解决方法
在搭建Mysql环境的时候遇到了中文乱码问题,下面与大家分享下具体的解决方法,感兴趣的朋友可以参考下哈,希望对大家有所帮助

0评论2015-11-08112

更多推荐