# -*- coding: utf-8 -*-
import MySQLdb
import sitedb
for i in range(5):
print i
cred = sitedb.loadmysqlcredential()
db = MySQLdb.connect(host = cred["host"], user = cred["user"], passwd = cred["passwd"], db = "vg_site_db", charset = 'utf8')
db.close()
I have MySQL at the different servers: Windows and Linux. At the Win this code work correct. At the Linux on the third iterate mysql sad: Lost connection to MySQL server at 'reading initial communication packet', system error: 0.
What I have to change at the Linux server?
UPD:
The problem is that I have loop (for), and when i = 0 connection happen, also like i = 1 and 2, but next the connection blocked