I am a high school student trying to practice python mysql connectivity on colab. the typical code for opening connection doesnt work and shows 111. please help
error:
ConnectionRefusedError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/mysql/connector/network.py in open_connection(self)
508 self.sock.settimeout(self._connection_timeout)
–> 509 self.sock.connect(sockaddr)
510 except IOError as err:
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
InterfaceError Traceback (most recent call last)
5 frames
/usr/local/lib/python3.10/dist-packages/mysql/connector/network.py in open_connection(self)
509 self.sock.connect(sockaddr)
510 except IOError as err:
–> 511 raise errors.InterfaceError(
512 errno=2003, values=(self.get_address(), _strioerror(err)))
513 except Exception as err:
InterfaceError: 2003: Can’t connect to MySQL server on ‘localhost:3306’ (111 Connection refused)
i tried searching for answers but they were for linux users
janhvi rauniyar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.