I'm attempting to build a Virtual Machine to develop a Django application. The OS is Ubuntu 10.10. I have most everything installed. The last piece is getting MySQLdb to work with the MySQL instance that comes with XAMPP.
How can I get MySQLdb to default to work with the XAMPP MySQL?
I found this: Accessing a XAMPP mysql via Python
I understand the problem there, but the solution doesn't work for me because Django handles creating connections behind the scenes. I also don't want to be manipulating Django for some an application.
I've attempted to modify the My.cnf in two different ways but it doesn't work. I'm still getting the same error. That error is listed here:
Traceback (most recent call last):
File "test-mysqldb.py", line 4, in <module>
db = MySQLdb.connect( user="root", passwd="", db="faceless001" )
File "/usr/lib/pymodules/python2.6/MySQLdb/__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "/usr/lib/pymodules/python2.6/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)")
XAMPP installed itself to: /opt/lampp/
I'm looking for the simplest, correct solution for this. Any background info you can share would be helpful, also.