当前位置:网站首页>Redis setting password

Redis setting password

2022-06-23 07:15:00 qq_ thirty-seven million two hundred and seventy-nine thousand

One . The first way ( At present this kind of linux To configure redis The password method is a temporary , If redis The password will be invalid after restart ,)

(1) First of all to enter redis, If it's not on redis You need to open it first :

[[email protected] bin]# redis-cli -p 6379
127.0.0.1:6379>

(2) View the current redis Have you set the password :

127.0.0.1:6379> config get requirepass

  1. “requirepass”
  2. “”

(3) There is no password for the above display , Now set the password :

127.0.0.1:6379> config set requirepass abcdefg
OK
127.0.0.1:6379>

(4) Check the current... Again redis You need a password :

127.0.0.1:6379> config get requirepass
(error) NOAUTH Authentication required.
127.0.0.1:6379>

2. The second way ( Permanent way )

If you need to configure the password permanently, go redis.conf Found in the configuration file for requirepass This parameter , The following configuration :

 modify redis.conf The configuration file   
requirepass foobared  Change it to 
requirepass 123    Specified password 123

Restart after saving redis That's all right. .

原网站

版权声明
本文为[qq_ thirty-seven million two hundred and seventy-nine thousand ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230623344322.html