Mac下通過Homebrew安裝redis

2021-08-20 17:22:45 字數 739 閱讀 8595

安裝命令 

brew install redis 

開機啟動redis命令 

$ ln -sfv /usr/local/opt/redis/*.plist ~/library/launchagents

使用launchctl啟動redis server 

$ launchctl load ~/library/launchagents/homebrew.mxcl.redis.plist

使用配置檔案啟動redis server 

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

停止redis server的自啟動 

$ launchctl unload ~/library/launchagents/homebrew.mxcl.redis.plist

redis 配置檔案的位置 

/usr/local/etc/redis.conf

解除安裝redis和它的檔案 

rm ~/library/launchagents/homebrew.mxcl.redis.plist

測試redis server是否啟動 

$ redis-cli ping       返回pong代表已經啟動

開啟redis server服務

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

停止redis server服務

redis-cli shutdown

Mac下通過Homebrew安裝MySQL

安裝完成之後,安裝其他的軟體就特別方便了。執行 brew install mysql等成功安裝完成,結果想要登入的時候報了個錯誤 error 2002 hy000 can not connect to local mysql server through socket tmp mysql.sock ...

Mac下通過Homebrew安裝MySQL

安裝完成之後,安裝其他的軟體就特別方便了。執行 brew install mysql等成功安裝完成,結果想要登入的時候報了個錯誤 error 2002 hy000 can not connect to local mysql server through socket tmp mysql.sock ...

Mac下通過Homebrew安裝MySQL

安裝完成之後,安裝其他的軟體就特別方便了。執行 brew install mysql等成功安裝完成,結果想要登入的時候報了個錯誤 error 2002 hy000 can not connect to local mysql server through socket tmp mysql.sock ...