当前位置:网站首页>Windows redis installation and simple use
Windows redis installation and simple use
2022-06-25 23:29:00 【Justion_】
Demand background
Currently using Alibaba Egg.js Develop background applications , Considering that some highly concurrent interfaces often call database queries , So add Redis As a server-side cache .
Solution
1、 install Redis, Because the system is Windows7, Therefore, you need to download the corresponding Windows Version of , Download address :https://github.com/MicrosoftArchive/redis/releases
2、 Simple configuration Redis start-up , by Redis Add password to your connection , To ensure safety
Core code
install Redis
Visit the above 【 Download address 】, Select the version you want , an Assets Catalog , You can choose .msi File or .zip File download . If you download .msi file , You can perform the installation directly ( Check the corresponding check box ), If you download .zip file , You can refer to the link 【Window To configure Redis Environment and simple use 】 https://www.cnblogs.com/wxjnew/p/9160855.html To install and configure .
Check Windows service
With Windows7 For example , Can enter the Control panel \ All control panel items \ Management tools find 【 service 】, After the light , Find... In the service list Redis.
Redis Startup and shutdown
Once installed , We can start and shut down through services Redis 了 , We can view the task manager of the system , Check if... Is started redis-server, Here is redis-server Startup and shutdown commands :
$ redis-server.exe --service-start # start-up
$ redis-server.exe --service-stop # close Use cli
confirm redis-server After starting , We can execute redis In the catalog redis-cli.exe file , So you can connect to Redis 了 . Of course , We can also use the command line CMD To link Redis.
It can be done directly Redis Accessed :
$ redis-cli.exe -h 127.0.0.1 -p 6379
127.0.0.1:6379> set firstKey "moyufed"
OK
127.0.0.1:6379> get firstKey
"moyufed"
127.0.0.1:6379>Add password
stay Redis In the installation directory of , Yes redis.windows.conf ,redis.windows-service.conf Two documents , We use Notepad to open ( recommend Notepad++), Find the line that needs to set the password , Sure Ctrl + F lookup “requirepass” The line of ( Probably 386 Row position ), Set separately Redis password ( Get rid of the front “#”), Example :
requirepass moyufedUse Redis
Restart after modification redis-server , Now connect Redis after Redis Access requires login , Example :
[email protected] C:\Users\Administrator
$ redis-server.exe --service-stop
[42636] 25 Feb 18:42:53.622 # Redis service successfully stopped.
[email protected] C:\Users\Administrator
$ redis-server.exe --service-start
[38828] 25 Feb 18:42:58.576 # Redis service successfully started.
[email protected] C:\Users\Administrator
$ redis-cli.exe -h 127.0.0.1 -p 6379
127.0.0.1:6379> set firstKey "moyufed"
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth moyufed
OK
127.0.0.1:6379> set firstKey "moyufed"
OK
127.0.0.1:6379> get firstKey
"moyufed"
127.0.0.1:6379>Reference documents
Window To configure Redis Environment and simple use :https://www.cnblogs.com/wxjnew/p/9160855.html
Windows Next Redis Installation, configuration and use precautions :https://www.cnblogs.com/LMJBlogs/p/11550170.html
边栏推荐
猜你喜欢

STM32 development board + smart cloud aiot+ home monitoring and control system

Kubernetes cluster construction of multiple ECS

1281_ FreeRTOS_ Implementation analysis of vtaskdelayuntil

Xinchida nd04 nd04c nrf52832 (52810) ble module (low power Bluetooth communication module) at command test

LM small programmable controller software (based on CoDeSys) note XVII: PTO pulse function block

Circuit module analysis exercise 5 (power supply)

ES6 const constants and array deconstruction

毕业旅行 | 伦敦5日游行程推荐

LM小型可编程控制器软件(基于CoDeSys)笔记十七:pto脉冲功能块

Oracle - getting started
随机推荐
【AXI】解读AXI协议原子化访问
ES6 const constants and array deconstruction
【ModuleBuilder】GP服务实现SDE中两个图层相交选取
Pycharm student's qualification expires, prompting no suitable licenses associated with account solution
Idea FAQ collection
How to solve the problem of SQL?
Applets - view and logic
ES6 learning -- let
建立自己的网站(15)
Xampp重启后,MySQL服务就启动不了。
UE4 学习记录二 给角色添加骨架,皮肤,及运动动画
[eosio] eos/wax signature error is_ Canonical (c): signature is not canonical
【2023校招刷题】番外篇1:度量科技FPGA岗(大致解析版)
Unity technical manual - getKey and getaxis and getbutton
Baidu: in 2022, the top ten hot spots will rise and the profession will be released. There is no suspense about the first place!
Multithreaded learning 1
Pit resolution encountered using East OCR (compile LAMS)
golang Make a list of intervals with sequential numbers
Equivalence class, boundary value, application method and application scenario of scenario method
The sum of logarithms in group 52--e of Niuke Xiaobai monthly race (two points)