Error 10061 connecting to localhost:6379. 由于目标计算机积极拒绝,无法连接。
来源:9-11 通过redis记录发送的验证码

我有何罪
2020-02-11
Traceback (most recent call last):
File “C:PythonStudyenvmxonlinelibsite-packages
edisconnection.py”, line 552, in connect
sock = self._connect()
File “C:PythonStudyenvmxonlinelibsite-packages
edisconnection.py”, line 609, in _connect
raise err
File “C:PythonStudyenvmxonlinelibsite-packages
edisconnection.py”, line 597, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:/Users/59796/PycharmProjects/MxOnline/tools/redis_test.py”, line 5, in
r.set(“mobile”, “123”)
File “C:PythonStudyenvmxonlinelibsite-packages
edisclient.py”, line 1766, in set
return self.execute_command(‘SET’, *pieces)
File “C:PythonStudyenvmxonlinelibsite-packages
edisclient.py”, line 875, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File “C:PythonStudyenvmxonlinelibsite-packages
edisconnection.py”, line 1185, in get_connection
connection.connect()
File “C:PythonStudyenvmxonlinelibsite-packages
edisconnection.py”, line 557, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 10061 connecting to localhost:6379. 由于目标计算机积极拒绝,无法连接。.
Process finished with exit code 1
1回答
-
你本地没有启动redis服务器
20
相似问题