当前位置: 首页 > ai >正文

Mac OS上安装Redis

以下内容来自官网,如果百度或者deepseek搜索出的安装方式不太行可以试试:

Install using Homebrew

First, tap the Redis Homebrew cask:

brew tap redis/redis

Next, run brew install:

brew install --cask redis

Run Redis

If this is the first time you've installed Redis on your system, you need to be sure that your PATH variable includes the Redis installation location. This location is either /opt/homebrew/bin for Apple silicon Macs or /usr/local/bin for Intel-based Macs.

To check this, run:

echo $PATH

Next, confirm that the output contains /opt/homebrew/bin (Apple silicon Macs) or /usr/local/bin (Intel Mac). If neither /opt/homebrew/bin nor /usr/local/bin are in the output, add them.

Open the file ~/.bashrc or ~/.zshrc (depending on your shell), and add the following line.

export PATH=$(brew --prefix)/bin:$PATH

You can now start the Redis server as follows:

redis-server /opt/homebrew/etc/redis.conf

The server will run in the background.

Note:

Because Redis is installed using a Homebrew cask with the brew tap command, it will not be integrated with the brew services command.

Connect to Redis

Once Redis is running, you can test it by running redis-cli:

redis-cli

Test the connection with the ping command:

127.0.0.1:6379> PING
PONG

Stop Redis

Run the following command:

redis-cli SHUTDOWN

Uninstall Redis Open Source

To uninstall Redis, run:

brew uninstall redis
brew untap redis/redis
http://www.xdnf.cn/news/14467.html

相关文章:

  • Python 正则表达式
  • 解决戴尔电脑No bootable devices found问题
  • TIA Portal (博图) 中 SCL 语言 REPEAT_UNTIL循环语句的用法介绍及案例
  • 资源占用多,Linux 系统中如何降低 CPU 资源消耗并提升利用率?
  • CentOS 7 虚拟机网络配置异常 典型问题:启动了NetworkManager但是network无法启动
  • 03.【C语言学习笔记】分支和循环
  • 网络层协议 IP 协议介绍 -- IP 协议,网段划分,私有 IP 和 公网 IP,路由
  • 设计模式笔记_创建型_单例模式
  • 【图像处理入门】9. 基础项目实战:从去噪到图像加密
  • 接口适配器模式实现令牌桶算法和漏桶算法
  • 加密、加签、摘要算法对比
  • 自然语言处理【NLP】—— CBOW模型
  • 浅谈快排的退化与优化
  • 鼠标报告描述符与对应的数据结构体
  • 实现汽车焊装线设备互联:DeviceNet与Modbus TCP协议转换网关
  • Debian 编译安装 ruby3.2
  • stm32使用定时器PWM
  • Linux编程:4、进程通信-管道(匿名管道)
  • 二手商城系统+SpringBoot + Vue (前后端分离)
  • 通用embedding模型和通用reranker模型,观测调研
  • 嵌入式学习笔记C语言阶段--17共用体和枚举
  • LG P4278 带插入区间K小值 Solution
  • SCADA|KingSCADA通过组合框选择修改变量的值
  • JS进阶 Day04
  • 2GT 环形闭口闭环同步带一种具有特定齿形和结构的传动带
  • MotleyCrew ——抛弃dify、coze,手动搭建多agent工作流
  • Cangejie Magic智谱AI文生图API实战详解
  • 洛谷 排队接水 贪心
  • 2025CVPR最佳论文系列
  • AI 产品设计头脑风暴