Home > Database > Mysql Tutorial > body text

redis简单安装使用

WBOY
Release: 2016-06-07 15:56:23
Original
1230 people have browsed it

官方网站:http://redis.io/ 官方下载:http://redis.io/download 可以根据需要下载不同版本 windows版:https://github.com/mythz/redis-windows github的资源可以ZIP直接下载的。 下载完成之后执行如下步骤: 1. 解压redis文件,进入bin目录会有一个release

官方网站:http://redis.io/

官方下载:http://redis.io/download 可以根据需要下载不同版本

windows版:https://github.com/mythz/redis-windows

github的资源可以ZIP直接下载的。

\

下载完成之后执行如下步骤:

1. 解压redis文件,进入bin目录会有一个release文件,一个是window 32位与window 64位,把对应的包解压出来,然后把里面的文件拷贝回bin目录

\

2. 设置环境变量,变量值是redis-2.6的根目录

\

把这个环境变量添加进path路径里

\

3.开启服务端,打开一个命令窗口,输入: redis-server或redis-server 根目录\redis.conf

\

4.此时不要关闭这个命令窗口,新开一个命令窗口,输入redis-cli -h 127.0.0.1 -p 6379

-h 是你主机的地址默认一般是127.0.0.1

-p 是你服务端的端口号

\

5.在命令行里输入 set userName user1,redis的内储机制是基于键/值的方式,所以当需要取出数据时,就在命令行里输入get userName 就可以取出userName所对应的值

\

FlushDB:清除内存数据库所有数据

FlushAll:清除内存数据库里所有的值。

\

Redis.conf的参数设置

\

这里需要你指定的根录目

\

这里城要你指定内存数据库的大小

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!