Home  >  Article  >  Database  >  How to set redis password under Linux

How to set redis password under Linux

WBOY
WBOYforward
2023-05-28 08:23:593386browse

The server has redis installed. For security, set the password to access redis-server.

How to set redis password under Linux

1. Open the redis configuration file

vi` `/usr/local/redis/etc/redis``.conf

Add the requirepass password

Will bind 127.0.0.1::1 before #Remove

Save and exit

2. Close redis

/usr/local/redis/bin/redis-cli` `shutdown

Start redis

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

3. Check

/usr/local/redis/bin/redis-cli
How to set redis password under Linux

The password has been set successfully. A password is required to enter. Enter the password

How to set redis password under Linux
How to set redis password under Linux
##4. How to close redis after setting the password

/usr/local/redis/bin/redis-cli` `-a 密码 ``shutdown

The above is the detailed content of How to set redis password under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete