Tell me why it does not connect from the host server to the database on the VPS server. This script works from my computer, even without the connect_timeout parameter.
#!/usr/bin/python import MySQLdb login = "serj3" password = "12345678" db = MySQLdb.connect(db='fatum', host="хх.хх.хх.хх", user="root", passwd="хххххххх", connect_timeout=150) c = db.cursor() add_gamer = "INSERT INTO accounts(login, password) VALUES (%s,%s) ",(login,password) c.execute(*add_gamer) db.commit() db.close()
. According to the documentation, 150 is seconds, but it turns around 10 seconds and gives an error 500. They write in the logs that they could not connect, the connection timed out. _mysql_exceptions.OperationalError: (2003, 'Can \' t connect to MySQL server on \ 'xxx.xxx.xxx.xx \' (110 "Connection timed out") ')