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

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.dtcms.com/a/254014.html

相关文章:

  • 【windows常见文件后缀】
  • MongoDB学习记录(快速入门)
  • MYSQL进阶超详细总结2.0
  • 2024-2025学年度下期《网页设计》期末模拟测试
  • 【软考高级架构设计师】——2024年下半年软考真题(回忆版)
  • 12.OpenCV—基础入门
  • 网卡故障排查-nic link is down
  • NL2SQL:解锁可视化数据分析的新姿势
  • DIDCTF-应急响应
  • 深入理解mysql索引
  • 分布式顺序数据发生器
  • C. Bertown Subway
  • 解决戴尔电脑No bootable devices found问题
  • 数据结构——选择题—查漏补缺
  • b站视频如何下载到电脑上
  • 神经网络模型的统计学具现
  • 【MPC】模型预测控制笔记 (4):约束输出反馈MPC
  • crackme009
  • FPGA基础 -- Verilog 结构建模
  • 百度下拉框出词技术解密:72小时出下拉词软件原理分享
  • 零基础开始的网工之路第二十一天------性能优化
  • 从 native 获取 AndroidId,Frida 获取 native 堆栈
  • Vue.js第二节
  • 使用duckduckgo_search python api 进行免费且不限次数的搜索
  • 【unitrix】 3.1 新基本结构体(types1.rs)
  • Python从入门到精通
  • WebRTC(六):ICE协议
  • c++面试题(24)-----数组中出现次数超过一半的数字
  • VisionMaster标定板像素标定,测量尺寸以及opencv/C++实现
  • 【C语言极简自学笔记】重讲运算符