Hi. I have a source installation of mysql 5.0.18 along with packaged
binary mysql-client libraries for mysql 4.x. This causes me some
trouble because it seems the default socket location has changed for
/var/run/mysqld/mysqld.sock to /tmp/mysqld.sock. For example:
>>> import MySQLdb
>>> MySQLdb.connect(host =3D "localhost", user =3D "root", db =3D "test")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/MySQLdb/__init__.py", line
66, in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line
134, 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' (13)")
That doesn't work because there is no domain socket there. But if you
specify the socket explicitly:
>>> m.connect(host =3D "localhost", user =3D "root", db =3D "test",
unix_socket=3D"/tmp/mysql.sock")
<_mysql.connection open to 'localhost' at 81ff9ec>
It works fine. I haven't found a way in SQLObject to specify a
database URI using a unix domain socket in a non-default location.
Excuse me if there already is a way, but If there isn't, then maybe
that can be added? Maybe this issue is that TurboGears ticket
http://trac.turbogears.org/turbogears/ticket/305 is about, but I can't
tell for sure. Oh, and I already know it is not a good idea to allow
passwordless root-logins to your db. :)
--
mvh Bj=F6rn
|