如何在redis数据库之间切换? [英] How do I change between redis database?

查看:97
本文介绍了如何在redis数据库之间切换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 redis 新手,我不知道如何创建和更改到另一个 redis 数据库.

I am new with redis and I didn't figured out how to create and change to another redis database.

我该怎么做?

推荐答案

默认情况下有 16 个数据库(索引从 0 到 15),您可以使用 选择 命令.可以使用 databases 设置在 redis 配置文件中更改数据库的数量.

By default there are 16 databases (indexed from 0 to 15) and you can navigate between them using select command. Number of databases can be changed in redis config file with databases setting.

默认选择数据库0.要选择指定的一个,请使用redis-cli -n 2(选择db 2)

By default, it selects the database 0. To select a specified one, use redis-cli -n 2 (selects db 2)

这篇关于如何在redis数据库之间切换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆