I'm trying to connect a machine script X to a database on the machine Y. I can handle the bank perfectly on the machine Y, but when I run the machine X I get the error below:
"2003 (HY000): Can't connect to MySQL server on '172.22.128.1:3306 (10060)"
Below my connection script inserted into the machine Y
declaracao = f'INSERT INTO similares (momento,produto1,produto2,res) VALUES ("teste","teste","teste",10.00);'
try:
#CREATE CONNECTION MYSQL
con = mysql.connector.connect(user='root', password='root', host='172.22.128.1', database='saneamento') #Here where to return the error
cursor = con.cursor()
cursor.execute(declaracao)
con.commit()
print(cursor.rowcount, "Insert dados!")
cursor.close()
except Error as e:
print("Fail", e)
Below computer IP X
Adress IPv4. . . . . . . . . . . . . . . : 172.22.128.1
Computers X and Y are on the same network