Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
96 views
in Technique[技术] by (71.8m points)

How to create own database in redis?

There are 0 to 15 databases in redis. 

I want to create my own database using redis-cli. Is there any command for it?

question from:https://stackoverflow.com/questions/35621324/how-to-create-own-database-in-redis

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Redis database is not an equivalent of database names in DBMS like mysql. It is a way to create isolation and namespacing for the keys, and only provides index based naming, not custom names like my_database.

By default, redis has 0-15 indexes for databases, you can change that number databases NUMBER in redis.conf.

And then you use SELECT command to select the database you want to work on.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...