debugging connection to mysql from python script using MySQLdb

Posted by timpone on Server Fault See other posts from Server Fault or by timpone
Published on 2010-06-11T04:19:36Z Indexed on 2010/06/11 4:24 UTC
Read the original article Hit count: 289

Filed under:
|

I am a python newbie and have a python 2.5 script that is using MySQLdb to connect on OS X 10.5.8. I haven't been able to succesfully connect to the database of interest with this. However, I am able to connect using php's mysqli and also via the mysql cli interface.

I get the error:

File "build/bdist.macosx-10.5-i386/egg/MySQLdb/connections.py", line 188, in __init__
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'arc_development'@'localhost' (using password: YES)")

On my linux box which has the same mysql perms, the script works fine logging in. On my OS X laptop, I am able to create a database named test_python which bypasses mysql authentication scheme. This makes me think that issues like 32bit / 64bit incompatabilities aren't occuring.

If I turn on the query log, I get access denied:

100610 20:56:55       4 Connect     Access denied for user 'arc_development'@'localhost' (using password: YES)

I'm a little bit at a loss to what to do next. Is there any way I can specify in the general log or binary log to get the actual password set on the connection string? How about writing out from connections.py file the value (although not sure how I'd do that)?

thanks

© Server Fault or respective owner

Related posts about mysql

Related posts about python