Reputation: 81
I am using Ubuntu and I have REDIS database, I want to create namespace or database in REDIS but I couldn't find any command for it.
Upvotes: 1
Views: 5317
Reputation: 5689
Redis comes with 16 databases by default. You can select any of them using select command. select 0, if you want to have more than that you can change that in the redis.conf file. Under GENERAL section set the value of databases to your desired number. Then you need to start your redis server with the config file ie, redis-server redis.conf
Upvotes: 1
Reputation: 22981
You don't need to create database explicitly. Redis has already created 16 databases by default (you can change the number of databases with redis.conf).
These databases are named (indexed) with a number beginning from 0, and the default database you're using is database 0. If you want to operate on other databases, you can use the select command to switch between these databases. For example, switch to database 1 with the following command.
select 1
After that, any subsequent commands will operate on database 1.
Upvotes: 1