Connection issue under Win2003 / MySQL 5.1

Asked by Warwick Prince

This appears to be a bug, but I'll ask the question first.. :-)

I have been using the connector for a week or so under the above config and all was fine. The, suddenly I can not connect to the MySQL server. I'm using SQLAlchemy and all I want to do it create the engine and connect. In SQLAlchemy land this is

e = create_engine(details..)
e.connect()

I'm getting an error which I've traced to code in cursor.py

    def set_connection(self, db):
        try:
            if isinstance(db.conn.protocol,protocol.MySQLProtocol):
                self.db = weakref.ref(db)
                if self not in self.db().cursors:
                    self.db().cursors.append(self)
        except Exception as message:
            raise errors.InterfaceError(errno=2048)

There is no value in db.conn (It's None), and therefore it throws 2048. So, my question is, under what circumstances could there be None value in db.conn? I have the exact same database, connector version and SQLAlchemy version running perfectly on my XP VM - and - this USED to work on 2003 ?? I have been bogged down for two days attempting to solve this so any help would be most appreciated.

It's throwing this error where in SQLAlchemy it first attempts to "SELECT DATABASE ()"

Warwick

Question information

Language:
English Edit question
Status:
Solved
For:
MySQL Connector/Python Edit question
Assignee:
No assignee Edit question
Solved by:
Warwick Prince
Solved:
Last query:
Last reply:
Revision history for this message
Warwick Prince (warwickp) said :
#1

Update:

After posting this, I was prompted to do a diff on the cursor.py on my XP and my cursor.py on the failing 2003. It was different and the db.conn error was seemingly fixed. I copied the version and now it all works! What I don't get is, I did not change the version of cursor.py from when it appeared to work to when it stopped.. So - go figure. :-S