I am using Python 2.7 on OSX Lion and can’t connect to a remote SQL Db on Python. I get the following error:
Traceback (most recent call last):
File "connectDB.py", line 39, in <module>
main()
File "connectDB.py", line 16, in main
db = MySQLdb.connect(HOST, USER, PASSWORD, DBNAME )
File "build/bdist.macosx-10.7-intel/egg/MySQLdb/__init__.py", line 81, in Connect
File "build/bdist.macosx-10.7-intel/egg/MySQLdb/connections.py", line 187, in __init__
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'ekogan'@'dyn-209-2-217-168.dyn.columbia.edu' (using password: YES)")
I know my host and user/pass work because I’m able to access it via PHP. But for some reason it’s denied here. Could there be some SQL versioning issues? I am totally unsure of how to proceed.
PHP probably does not access your MySQL server as a remote host. Python probably does. So check your permissions.