Hi,
I'm trying to learn how to access databases using python but I'm having some problems. I've imported MySQLdb but when I run the command
Code:
cxn = MySQLdb.connect(user='root')
I get the error
Code:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.5/MySQLdb/__init__.py", line 74, in Connect
return Connection(*args, **kwargs)
File "/var/lib/python-support/python2.5/MySQLdb/connections.py", line 170, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
I've found various suggestions but I don't know which to try. Any suggestions would be appreciated. TAI
Bookmarks