search

Home  >  Q&A  >  body text

Redis有没有多个数据库和账号系统的概念?

我是前端,数据库小白,最近在学习MySQL和Redis。

学习Redis的时候懵逼了,因为它和MySQL完全不一样。

我指的不是SQL和NoSQL的区别,是我完全没有发现Redis有账号的概念和创建数据库的概念。难道Redis只有一个账号和一个数据库吗?

过去多啦不再A梦过去多啦不再A梦2772 days ago802

reply all(3)I'll reply

  • 滿天的星座

    滿天的星座2017-04-25 09:04:30

    1. No account, only a lightweight auth password authentication

    /etc/redis.conf

    requirepass myPassword
    1. There is no database similar to mysql, only key/value database, which is equivalent to each key being a database, and then value can correspond to N types, strings, lists, sets, etc.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-04-25 09:04:30

    Multiple databases: yes, switch by select

    User: None

    Another more recommended usage is that if you really have multiple "database" needs, you can run multiple redis instances at the same time to divide them

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-25 09:04:30

    Redis does not have the concept of an account. Only Host and Port are needed to connect to the Redis server.

    Redis is an in-memory database, but Redis will persist the data in the memory to the disk regularly. As for the circumstances under which Redis will persist the data to the disk, it can be configured in the configuration.

    When Redis starts, the files on the disk will be read into the memory.

    reply
    0
  • Cancelreply