mysqldb issue

fedor f.baart at
Thu Mar 10 14:07:44 CET 2005

Hi all,
 I have a problem with mysql connections. After about 28000-29000 
 connections, I get a "Can't connect to MySQL server on ''" error.
 I have made a small program which generates the error
 import MySQLdb
 for i in range(30000):
     if not i % 100:
         print i
     db = MySQLdb.connect(host='', user='me',passwd='mypassword')
     c = db.cursor()
 This is the error after making about 28200 connections:
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/tmp/python-12448vuu", line 7, in ?
     db = MySQLdb.connect(host='', user='me', passwd='mypassword')
   File "/usr/local/lib/python2.3/site-packages/MySQLdb/", line 
 64, in Connect
     return apply(Connection, args, kwargs)
   File "/usr/local/lib/python2.3/site-packages/MySQLdb/", 
 116, in __init__
     self._make_connection(args, kwargs2)
   File "/usr/local/lib/python2.3/site-packages/MySQLdb/", 
 41, in _make_connection
     apply(super(ConnectionBase, self).__init__, args, kwargs)
 _mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server 
 '' (99)")
 Does anybody know how to solve this issue?
 System: Suse 8.1, mysql 4.0.14, mysqldb 1.0.1, python2.3 
 Thanks very much.....

More information about the Python-list mailing list