Home > Database > Redis > body text

How to solve the error when installing redis on ubuntu

WBOY
Release: 2023-06-02 21:56:24
forward
1617 people have browsed it

ubuntu system installation redis troubleshooting and solution

 $ 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安装
Copy after login

The following interface appears
How to solve the error when installing redis on ubuntu##

$ ln -s /usr/local/redis/src/redis-cli /usr/local/bin/ #配置环境,建立软连接$ redis-cli #看是否安装成功
Copy after login

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行)可能不一样自己找一下
Copy after login

How to solve the error when installing redis on ubuntu

$ redis-server /etc/redis.conf #开启客户端要确保服务端启动
Copy after login

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#发现启动成功
Copy after login

How to solve the error when installing redis on ubuntu

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!