how on Linux via the terminal to list all databases in Redis, and create a new one?

    2 answers 2

    In Redis, databases are accessible by integer indices, by default, 0-15, and their number is determined by the databases key in the config file (by default, obviously, 16). Knowing this number, you can immediately say how many Redis have bases (obviously) and how each of them is called (all names of the dbЧИСЛО type are dbЧИСЛО ). The number itself can be obtained by making CONFIG GET databases , or, as described in another answer, you can immediately see the list (and some other information) by executing the INFO keyspace .

    Create new ones ... you can increase the number of databases in Redis by changing the aforementioned databases key in redis.conf . Functionally, as a result of increasing this number, new, previously non-existent bases will become available.


    Sources:

      Try the INFO keyspace , it displays all the bases and the number of keys in them.