我是前端,数据库小白,最近在学习MySQL和Redis。
学习Redis的时候懵逼了,因为它和MySQL完全不一样。
我指的不是SQL和NoSQL的区别,是我完全没有发现Redis有账号的概念和创建数据库的概念。难道Redis只有一个账号和一个数据库吗?
滿天的星座2017-04-25 09:04:30
No account, only a lightweight auth password authentication
/etc/redis.conf
requirepass myPassword
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.
曾经蜡笔没有小新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
巴扎黑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.