mac os 开启redis_mac os 命令行安装 启动和停止 redis

简介

Redis时一个开源的非关系数据库,支持持久化存储。

安装

Mac os x下安装Redis很简单通过Brew安装即可。

如果没有安装 Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

首先,获取最新软件安装包

brew update

安装Redis

brew install redis

结果:

Ahmeds-iMac:~ x-xxx.com$ brew -v

Homebrew 1.2.2

Homebrew/homebrew-core (git revision e82a; last commit 2017-06-05)

Ahmeds-iMac:~ x-xxx.com$ brew install redis

Updating Homebrew...

==> Auto-updated Homebrew!

Updated 2 taps (homebrew/core, josegonzalez/php).

==> Updated Formulae

aws-sdk-cpp gphoto2 sdl_mixer

awscli heroku sdl_sound

bazel josegonzalez/php/wp-cli servus

citus knot svgcleaner

conan knot-resolver termius

docker-machine libgphoto2 vapoursynth

docker-machine-completion makepkg vim

ffmpeg mercurial wpcli-completion

freetds msgpack yara

==> Downloading https://homebrew.bintray.com/bottles/redis-3.2.9.sierra.bottle.t

######################################################################## 100.0%

==> Pouring redis-3.2.9.sierra.bottle.tar.gz

==> Using the sandbox

==> Caveats

To have launchd start redis now and restart at login:

brew services start redis

Or, if you don't want/need a background service you can just run:

redis-server /usr/local/etc/redis.conf

==> Summary

🍺 /usr/local/Cellar/redis/3.2.9: 13 files, 1.7MB

Ahmeds-iMac:~ x-xxxx.com$ redis-server

4297:C 07 Jun 17:44:26.735 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

4297:M 07 Jun 17:44:26.736 * Increased maximum number of open files to 10032 (it was originally set to 7168).

_._

_.-``__ ''-._

_.-`` `. `_. ''-._ Redis 3.2.9 (00000000/0) 64 bit

.-`` .-```. ```\/ _.,_ ''-._

( ' , .-` | `, ) Running in standalone mode

|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379

| `-._ `._ / _.-' | PID: 4297

`-._ `-._ `-./ _.-' _.-'

|`-._`-._ `-.__.-' _.-'_.-'|

| `-._`-._ _.-'_.-' | http://redis.io

`-._ `-._`-.__.-'_.-' _.-'

|`-._`-._ `-.__.-' _.-'_.-'|

| `-._`-._ _.-'_.-' |

`-._ `-._`-.__.-'_.-' _.-'

`-._ `-.__.-' _.-'

`-._ _.-'

`-.__.-'

4297:M 07 Jun 17:44:26.737 # Server started, Redis version 3.2.9

4297:M 07 Jun 17:44:26.737 * The server is now ready to accept connections on port 6379

出现上面代码表示安装成功了。

那么怎么启动它呢?

启动

在终端直接运行命令

redis-server

//Redis 默认端口是6379,你也可以换个端口号启动,

redis-server --port 6380

//使用了肯定需要停止,停止怎么弄呢?

//停止

//执行命令

redis-cli shutdown

如有错误或问题请留言

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值