After installing redis under the Linux system, the default is no password, you need to set the password yourself.
First open the configuration file vim redis.conf
Search for /requirepass# in the command line state
- ##Then add requirepass 123 in insert mode
- Close redis /usr/local/redis/bin/redis-cli shutdown
- Start redis/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
- Enter the client to view/ usr/local/redis/bin/redis-cli
- auth password can be used to enter
- Check the password under the client config get requirepass
If you have a password, you can log in first and then verify
You can also log in and verify directly
What is a Linux system
Linux is a UNIX-like operating system that is free to use and spread freely. It is a POSIX-based multi-user, multi-task, multi-thread and multi-CPU system. Operating system, Linux can run major Unix tool software, applications and network protocols.
The above is the detailed content of How to set redis password in Linux system. For more information, please follow other related articles on the PHP Chinese website!