windos下redis的启动与安装
一、启动redis
1.redis的安装
1.1.先下载redis,到https://github.com/MicrosoftArchive/redis/releases,下载Redis-x64-3.2.100.msi
1.9.安装完成后,在刚才安装中所选择的目录,如上图: 进入此文件夹下可修改redis的相关配置,可以在文件“redis.windows.conf”中修改,使用记事本打开这个文件修改保存即可。
注意:以井号(#)开头的行都是注释
【redis主机地址】默认绑定server本机,此时bind可以省略(bind 127.0.0.1)
【redis链接密码】默认redis没有链接密码,可以通过以下命令设置(requirepass 123),密码设置为abcd2020
2.redis的启动
- 打开位置为:C:\skhbEnvironment\redis
- 点击cmd
输入:cd C:\redis
输入:redis-server.exe redis.windows.conf,即就是
C:\redis>redis-server.exe redis.windows.conf
启动成功,如下图:
redis如果启动错误,报错如下:
10 Jun 11:37:13.018 # Creating Server TCP listening socket 127.0.0.1:6379: bind: No error
解决办法:
# for connections from all the network interfaces available on the server.
# It is possible to listen to just one or multiple selected interfaces using
# the "bind" configuration directive, followed by one or more IP addresses.
# Examples:
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1 ::1
# ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the
# internet, binding to all the interfaces is dangerous and will expose the
# instance to everybody on the internet. So by default we uncomment the
# following bind directive, that will force Redis to listen only into
# the IPv4 lookback interface address (this means Redis will be able to
# accept connections only from clients running into the same computer it
# is running).
# IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES
# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind 127.0.0.1 //去掉#
# Protected mode is a layer of security protection, in order to avoid that
# Redis instances left open on the internet are accessed and exploited.
# When protected mode is on and if:
重新执行命令行
D:\redis>redis-server.exe redis.windows.conf
若仍报以下错误:
# Creating Server TCP listening socket 127.0.0.1:6379: bind: No error
按顺序输入如下命令就可以连接成功
1. redis-cli.exe
2. shutdown
3. exit
4. redis-server.exe redis.windows.conf
二、启动后台:
新的jar包 放在 C:/skhbsoft/ new
Java –jar s+Tab 回车(两次)
三、启动前台:
- Shift+鼠标右键,点击:在此处打开powershell
http-server