Home  >  Article  >  Database  >  Why redis is safe

Why redis is safe

(*-*)浩
(*-*)浩Original
2019-08-02 15:39:402008browse

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.

Why redis is safe

##Example (Recommended learning: Redis video tutorial)

We can check whether password authentication is set by using the following command:

127.0.0.1:6379> CONFIG get requirepass<br>1) "requirepass"<br>2) ""<br>
By default, the requirepass parameter is empty, which means that you can connect to the redis service without passing password authentication.

You can modify this parameter through the following command:

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>
After setting the password, the client needs password verification to connect to the redis service, otherwise the command cannot be executed.

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>
More Redis For related technical articles, please visit the

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Why use redis clusterNext article:Why use redis cluster