Menu

Error 10048 while connecting to the DB

Help
M. H.
2008-03-28
2012-09-19
  • M. H.

    M. H. - 2008-03-28

    Hello everybody,

    As stated in the title, i've got an "10048" MySQL error with my application when a lot of query are processed preventing me from connecting to the DB.

    From what I've seen so far, this error code means that the client is trying to bind a port already in use. This could happens when no more free port are available. (This is not related to the maximum number of connections allowed in MySQL, but can be a consequence of a limitation of the OS.)

    The problem is that my application doesn't open several connexion at the same time, but open/close connection sequentially for each query. So, my guess is that this problem comes from a MySQLdb bug.

    I'm using MySQLdb 1.0.0, which is the only binary version i've found which bypass the limitations I have:
    - My app is Win32 dependant.
    - I've to use Python 2.3 and MySQL 4.1.

    I tried MySQLdb 1.2.2 for Mysql 4.0. But after changing all password hashes as required, there is still a problem with the date values extracted from the DB. According to the documentation of MySQLdb, it should use the MX library when available for DateTime formats, like the version 1.0.0 does. But for one reason or another, the 1.2.2 binary returns standard DateTime instances... not MX.DateTime, which cause some other bugs in my application...

    Ok... There is several way to (maybe) solve this problem:
    - Having a more up-to-date binary version of MySQLdb for Python 2.3 on Win32. (Does anyone have one?)
    - Compile MySQLdb by myself (Is that difficult?).
    - Fix MySQLdb 1.2.2 in order to use the MX libraries.
    - Fix my code in order to work without the MX libraries (it's not trivial because this is a old project and I'm not the author of most of the modules).

    Beside, i'm not even sure that a more recent version of MySQLdb will fix this...

    Does someone have some suggestions? Your help would be greatly appreciated...

    Thanks (and sorry for the poor english)
    Marc H.

     
    • Andy Dustman

      Andy Dustman - 2008-03-28

      OK, a lot of problems here.

      MySQLdb-1.0.0 is not guaranteed to work with anything newer than Python 2.0.

      You should not have to change your password hashes.

      MySQLdb-1.2.2 does not use mx.DateTime, it uses the Python 2.3 and later datetime module.

      If you must use mx.DateTime, you can still do this with 1.2.2. Use some of the old time conversion functions, and you can plug these into the type conversion dictionary.

      Try reading the documentation for the converters submodule with:

      $ pydoc MySQLdb.converters

      or

      >>> help("MySQLdb.converters)

      1.2.0 might require the least amount of work.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.