Unable to connect mysql from Pycharm


#1

import mysql.connector, datetime
cnx = mysql.connector.connect(user=“xxx”, password=“ixxxx”,
host=“nn01.itversity.com”,
database=“hr”)

C:\Users\Ravinder\PycharmProjects\jdbcDemo\venv\t\Scripts\python.exe C:/Users/Ravinder/PycharmProjects/jdbcDemo/src/main/python/mysqldemo.py
Traceback (most recent call last):
File “C:\Users\Ravinder\PycharmProjects\jdbcDemo\venv\t\lib\site-packages\mysql\connector\network.py”, line 509, in open_connection
self.sock.connect(sockaddr)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

I am getting above error and I have replaced xxx with proper access which i tried in labs


#2

@Ravinder_Karra,

It’s not possible to connect from an IDE to itversity cluster. try with IP address & port number.
I Know it will not work, but you can give a try & let us know here. So others will learn from it.