Home >Database >Redis >How to connect redis in linux

How to connect redis in linux

(*-*)浩
(*-*)浩Original
2019-11-27 09:22:0910733browse

How to connect redis in linux

Because there are many Linux distributions. Redis provides source code developed in C. It needs to be compiled to run, and a c compilation environment is required before compilation. (Recommended learning: Redis video tutorial)

Requires a gcc compilation environment in Linux. The way to install gcc is also very simple. First install the gcc compilation environment. If the server contains a compilation environment, please skip the first step.

Enter the redis installation directory cd /usr/local/redis/bin

Execute the ./redis-server startup command

If you see such an interface, it means that the startup is successful. The default port is 6379

How to connect redis in linux

This mode is the front-end startup mode, which will occupy a terminal. We generally use backend startup.

How to connect to redis

1 Enter cd /usr/local/redis/bin/

2 Execute ./redis-cli

If you see the following page, it means the connection is successful. The default connection is the local machine. If you want to connect to other addresses, you can use ./redis-cli -h 192.168.XX.XX -p 6379 to connect.

How to connect redis in linux

-h represents ip -p represents port. The default is 6379

For more Redis related technical articles, please visit Redis Getting Started Tutorial Column for learning!

The above is the detailed content of How to connect redis in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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