Hi All

Just to put closure on this issue, I finally sorted it out as a bug in the 
connector.  This has now been resolved and the latest build has the correction. 
:-)  As a matter of interest, the line db.conn.protocol should have been 
db.protocol..   Anyway - all's well that ends well.. :-)

Cheers
Warwick
> 
> On Aug 27, 2010, at 4:39 AM, Warwick Prince wrote:
> 
>> Hi Michael
>> 
>> OK, I've invested (wasted?) my entire day on this connection issue and have 
>> the following to report.  Hopefully, the hints I've managed to find may 
>> trigger something with you that will point me in the right direction.
>> 
>> In recap; the issue was I could not get a simple engine to connect to the 
>> MySQL database.  This used to work on this server with the current 
>> configuration and simply seemed to stop working.
>> 
>> e = create_engine('mysql+mysqlconnector://user:passw...@127.0.0.1/testdb', 
>> encoding='utf8', echo=False)
>> e.connect()
>> 
>> (Traceback below from previous messages)
>> 
>> So, I followed all the code through and found that it actually failing at 
>> the point where in cursor.py it's attempting to create a new cursor.
>> 
>>     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)
>> 
>> The db appears to be correct (I looked), protocol.MySQLProtocol appears to 
>> be correct BUT db.conn = None !  Therefore it raises 2048
>> 
>> So, after many hours I can not find where db.conn is set or what it is 
>> supposed to be in the first place!    Note: I have a virtually identical 
>> setup on my XP VM, and the same example of engine.connect() works fine.
>> 
>> What I'm looking for is a little info on what db.conn should be, where is it 
>> set, how can it be NOT set etc.    Your help would be most appreciated.
>> 
>> Incidentally, all was not a waste of time as I traversed nearly ALL of the 
>> SA code today and picked up a few nice tips..  Thanks! :-)
> 
> Well, that above is not part of SQLAlchemy.   I would assume, since its 
> called cursor.py and is dealing with MySQL internals, that its part of MySQL 
> connector, so you should email on their list (and also you can test things 
> without SQLAlchemy at all, just use a script with MySQL connector directly).
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to