Mac系统启动redis服务器报错:Could not create server TCP listening socket *:6379: bind: Address already in use

时间:2024-05-21 17:26:00

问题描述:Mac下已经安装好了redis,在终端启动redis时突然报错:Could not create server TCP listening socket *:6379: bind: Address already in use
,报错如下图所示:
Mac系统启动redis服务器报错:Could not create server TCP listening socket *:6379: bind: Address already in use
提示我6379端口地址(redis默认端口)被占用了。

解决办法:
1)在Mac终端使用ps -ef和grep命令查找并显示进程,命令语句如下:

ps -ef | grep -i redis

查找结果如下图所示:
Mac系统启动redis服务器报错:Could not create server TCP listening socket *:6379: bind: Address already in use

2)查找到PID为65947,使用kill -9 命令强制杀掉该进程,命令语句如下:

kill -9 65947

操作如下图所示:
Mac系统启动redis服务器报错:Could not create server TCP listening socket *:6379: bind: Address already in use

3)进入到redis目录下,重新启动redis,语句如下所示:

src/redis-server

结果如下图所示:

Mac系统启动redis服务器报错:Could not create server TCP listening socket *:6379: bind: Address already in use