NoSql之Redis的安装配置以及常用命令

官网地址:

Https://redis.io/download

redis的windoms版只能到redis的github官网下载:

https://github.com/microsoftarchive/redis/releases

注册全局的环境变量,方便使用

服务端启动命令:redis-server.exe redis.windows.conf
	或者redis-server.exe
 redis.windows.conf 可以省略,如果省略,会启用默认的

客户端启动命令:redis-cli.exe -h 127.0.0.1 -p 6379

 

redis-server.exe (.exe有无均可)
redis-server.exe redis.windows.conf
redis-cli.exe
redis-cli.exe -h 127.0.0.1 -p 6379
redis-cli.exe -h 127.0.0.1 -p 6379 -a 123456

redis-server.exe --service-install redis.windows.conf 
redis-server --service-install redis.windows-service.conf --loglevel verbose(注册为Windows服务)
redis-server --service-uninstall
redis-server --service-start
redis-server --service-stop
redis-server --service-name name(重命名)

redis-server --service-install --service-name redisService1 --port 10001
redis-server --service-start --service-name redisService1

ping
quit
AUTH "pwdstring"
ECHO "hello world!!"
SELECT 1   #使用1号数据库
SET db_number 1
GET db_number
CLIENT SETNAME
CLIENT GETNAME

CONFIG GET *
CONFIG SET loglevel "notice"
CONFIG GET loglevel
CONFIG set requirepass "pwdstring"
CONFIG get requirepass

shutdown
INFO  //redis服务器的统计信息
BGSAVE //在后台异步保存当前数据库的数据到磁盘
CLIENT LIST 
CLIENT KILL [ip:port] [ID client-id] 关闭客户端连接
SAVE //同步保存数据到硬盘
SHUTDOWN [NOSAVE/SAVE] //异步保存数据到硬盘,并关闭服务器
MONITOR //实时打印出 Redis 服务器接收到的命令,调试用
FLUSHDB //删除当前数据库的所有key

Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合)。

具体参见博客redis常用命令

Redis图形化客户端管理软件

Redis Desktop Manage:https://github.com/uglide/RedisDesktopManager

Redis Client:https://github.com/caoxinyu/RedisClient

Redis Studio:https://github.com/cinience/RedisStudio

发布了152 篇原创文章 · 获赞 78 · 访问量 50万+

猜你喜欢

转载自blog.csdn.net/qiuzhi__ke/article/details/105341519