The default port for Redis is 6379, you can use a maximum of 16 databases, and the database is independent from one another.
Different databases can be accessed by select Num
The following commands can be used to switch to different databases, each with its own space, without worrying about key conflicts.
The FLUSHDB command clears the data and clears only the data under the current database, without affecting other databases.
Multi-Port using Redis
Use Redis on the same machine, enable multiple ports, implement multiple instances, complete the simulation of the cluster implementation.
A new port (process) can then be opened via Redis-server-port 6378.
However, this is not recommended because it takes a lot of effort to maintain the new port
Redis Configuration Authentication Password
1. Configuring with configuration Files
The Yum-style installation of Redis profiles is typically in/etc/redis.conf, which opens the configuration file to find
#requirepass foobared
Remove the comment before the line, and change the password to the desired password, save the file
requirepass mypassword
Restart Redis
sudo service Redis restart# or sudo service Redis Stopsudo redis-server/etc/redis.conf
This is the time to try to log in to Redis and find that it is possible to mount, but the specific command is prompt operation is not allowed
Try to log in with a password and execute a specific command to see that it can be executed successfully
Redis uses multiple database and password configurations