Menu

#13 Add database and user attributes to connection object

open
MySQLdb (19)
5
2012-09-19
2006-10-12
Andy Todd
No

I often switch between different dbs at the same
destination in my code. Which means that I inevitably
get confused about exactly which one I am connected to
at any one time.

It would be nice if I could just check some attributes
on the connection object to find out who I am connected
as and which database I am using.

The connection object currently has methods to
determine host, server and protocol information but I
presume these are provided by the underlying library.

I've searched through the MySQL and MySQL Python
documentation and I cant find a way to get this
information at the moment.

Discussion


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.