Redis installed on a Mac

First, install

First ensure brew on the computer and then install it using the following command

brew install redis

Second, the commonly used commands

1. Start redis service

brew services start redis

2. Close redis service

brew services stop redis

3. Restart redis service

brew services restart redis

4. Open the graphical interface

redis-cli

The boot command redis

ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

6. Start redis-server configuration file

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

7. Stop redis service

redis-cli shutdown

8. redis configuration file location

/usr/local/etc/redis.conf

9. Uninstall redis

brew uninstall redis rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

10. allow remote access

vim /usr/local/etc/redis.conf

Notes bind, by default redis does not allow remote access, allowing only access to the machine.

#bind 127.0.0.1

Note: After redis3.2, redis increase the protected-mode, in this mode, even if commented out bind 127.0.0.1, and then access redisd time or error, need to protected-mode yes instead protected-mode no

Guess you like

Origin www.cnblogs.com/DI-DIAO/p/12588078.html