$ wget http://download.redis.io/releases/redis-6.0.6.tar.gz #wget命令下载redis安装文件,也可在官网下载压缩包 $ tar -xvf redis-6.0.6.tar.gz #将下载好的压缩包进行解压 $ mv redis-6.0.6 /usr/local/redis #把redis安装移动到/usr/local/里面,非必须 $ cd /usr/local/redis #进入该目录 $ make #执行make命令,等待redis安装
The following interface appears
##
$ ln -s /usr/local/redis/src/redis-cli /usr/local/bin/ #配置环境,建立软连接$ redis-cli #看是否安装成功An error was found:Could not connect to Redis at 127.0.0.1: 6379: Connection refused
not connected> exit
I encountered a problem from the beginning when using Redis,The client cannot be opened,The reason is that the server needs to be opened first,This requires First configure
$ cp redis.conf /etc #负责文件到etc目录$ cd /etc #进入该目录$ vi redis.conf #修改文件中 daemonize no 为 daemonize yes (222行)可能不一样自己找一下
$ redis-server /etc/redis.conf #开启客户端要确保服务端启动and find that there is still an error message:Command 'redis-server' not found, but can be installed with:sudo apt install redis-server
Looking for related issues, I found that ,just make will not work,you also need to perform a make install command
$ cd /usr/local/redis/src $ make install $ redis-server /etc/redis.conf#发现启动成功
The above is the detailed content of How to solve the error when installing redis on ubuntu. For more information, please follow other related articles on the PHP Chinese website!