I am trying to use mysql after working with sqlite in the past.
I installed XAMPP on linux (ubuntu) and I have mysql and it works fine (looks like with phpMyadmin atleast). However, I am having problems with MySQLdb (python lib) working, {installed this with apt}. to be precise:
>>> import MySQLdb >>> db = MySQLdb.connect(host="localhost",db="opfine") Traceback (most recent call last): File "<input>", line 1, in <module> 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) OperationalError: (2002, "Can't connect to local MySQL server through socket '/var /run/mysqld/mysqld.sock' (2)")
I suppose:
Can't connect to local MySQL server through socket '/var /run/mysqld/mysqld.sock
means that he is expecting some kind of local installation (i.e. not in XAMPP), but I canβt figure out how to do this to make it work with a mysql-like tasteful hub.
help rate!
python mysql
malangi
source share