We can set the password parameter through the redis configuration file, so that the client needs password verification to connect to the redis service, which can make your redis service more secure.
##Example (Recommended learning: Redis video tutorial)
127.0.0.1:6379> CONFIG get requirepass<br>1) "requirepass"<br>2) ""<br>
127.0.0.1:6379> CONFIG set requirepass "runoob"<br>OK<br>127.0.0.1:6379> CONFIG get requirepass<br>1) "requirepass"<br>2) "runoob"<br>
Grammar
The basic syntax format of the AUTH command is as follows:127.0.0.1:6379> AUTH password<br>
Example
127.0.0.1:6379> AUTH "runoob"<br>OK<br>127.0.0.1:6379> SET mykey "Test value"<br>OK<br>127.0.0.1:6379> GET mykey<br>"Test value"<br>
Introduction to Using Redis Database Tutorial column to learn!
The above is the detailed content of Why redis is safe. For more information, please follow other related articles on the PHP Chinese website!