您的位置:首页 > 数据库 > Redis

Mac、Ubuntu安装Redis

2017-08-08 00:36 393 查看

一、Ubuntu安装

Ubuntu安装Redis通过apt-get

$sudo apt-get update
$sudo apt-get install redis-server


Ubuntu卸载Redis通过apt-get

$sudo apt-get remove redis-server


二、Mac安装

Mac安装Redis通过brew

$sudo brew update

#sudo brew install redis


Mac卸载Redis通过brew

brew uninstall redis


三、常用操作

1、启动

//ubuntu
$redis-server

//mac
/usr/local/Cellar/redis/4.0.1/bin/redis-server &


2、命令窗口

$redis-cli

/usr/local/Cellar/redis/4.0.1/bin/redis-cli


3、验证是否安装成功



四、远程服务上执行命令

1、语法

redis-cli -h host -p port -a password


2、例子

redis-cli -h 192.168.0.137 -p 6379 [-a password]


五、配置文件目录

Mac的redis.conf位置

/usr/local/etc/redis.conf


Ubuntu的redis.conf位置

/etc/redis/redis.conf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: