否则可能出现连接错误。和windows下cmd运行tomcat类似。
[root@localhost redis]# redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected> redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>
[root@localhost redis]# redis-cli
127.0.0.1:6379> set name = wangxin
(error) ERR syntax error
127.0.0.1:6379> set name wangxin
OK
127.0.0.1:6379> set age 26
OK
127.0.0.1:6379> get name age
(error) ERR wrong number of arguments for 'get' command
127.0.0.1:6379> get name
"wangxin"
127.0.0.1:6379> get age
"26"
127.0.0.1:6379>
Ubuntu 12.10下安装Redis(图文详解)+ Jedis连接Redis
Redis安装部署学习笔记