Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i change the name of databases in redis?

How can i change the name of databases in redis? Example:

Db01
  key01
  key02

Db02
  key01
  key02

Db03
  key01
  key02

i want to change db01 name or db02, db03 to other names

like image 271
Daniel García Avatar asked Mar 11 '16 02:03

Daniel García


People also ask

How can I change database in Redis?

Redis databases are numbered from 0 to 15 and, by default, you connect to database 0 when you connect to your Redis instance. However, you can change the database you're using with the select command after you connect: select 15.

How do I find my Redis database name?

There is no command to do it (like you would do it with MySQL for instance). The number of Redis databases is fixed, and set in the configuration file. By default, you have 16 databases. Each database is identified by a number (not a name).

Can Redis have multiple databases?

Redis comes with support for multiple databases, which is very similar to the concept in SQL databases. In SQL databases, such as MySQL, PostgreSQL, and Oracle, you can define a name for your databases. However, Redis databases are represented by numbers.

What database does Redis use?

Amazon MemoryDB for Redis is a Redis-compatible, durable, in-memory database service that delivers ultra-fast performance. Amazon ElastiCache for Redis is a fully managed caching service that accelerates data access from primary databases and data stores with microsecond latency.


1 Answers

Redis databases are identified by an integer index, there is no database name.

By default there are 16 databases, indexed from 0 to 15.

Check the following article: https://www.digitalocean.com/community/cheatsheets/how-to-manage-redis-databases-and-keys

like image 179
thepirat000 Avatar answered Sep 20 '22 15:09

thepirat000