I've had scheduled a task working perfectly well for the past couple weeks. Last night, it just stopped working with this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.3/dist-packages/mysql/connector/network.py", line 383, in open_connection
self.sock.connect(sockaddr)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/alexpmil/filename.py", line 62, in <module>
db, cur = connectDB()
File "/home/alexpmil/filename.py", line 47, in connectDB
db = conn.connect(host="mysql.server",user="REDACTED",passwd="REDACTED", database="REDACTED")
File "/usr/local/lib/python3.3/dist-packages/mysql/connector/__init__.py", line 101, in connect
return MySQLConnection(*args, **kwargs)
File "/usr/local/lib/python3.3/dist-packages/mysql/connector/connection.py", line 117, in __init__
self.connect(**kwargs)
File "/usr/local/lib/python3.3/dist-packages/mysql/connector/connection.py", line 383, in connect
self._open_connection()
File "/usr/local/lib/python3.3/dist-packages/mysql/connector/connection.py", line 346, in _open_connection
self._socket.open_connection()
File "/usr/local/lib/python3.3/dist-packages/mysql/connector/network.py", line 386, in open_connection
errno=2003, values=(self.get_address(), _strioerror(err)))
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'mysql.server:3306' (111 Connection refused)
The script works from the bash console (python filename.py
), but I'm seeing this error in the scheduled tasks log.
Any help?