#148 mysqldb does not check file permissions

MySQLdb-1.2
closed
Andy Dustman
MySQLdb (285)
5
2012-09-19
2005-07-25
Anonymous
No

It seems mysqldb does not realize it has nor read
privilege to read a file and happily continues. It dies
much later with confusing message:

Traceback (most recent call last):
File "test19a.py", line 10, in ?
_c = connect(read_default_file =
"/home/mmokrejs/.my.cnf", read_default_group =
'IRESite', init_command = 'SET AUTOCOMMIT = 0')
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)")

mysql-python-1.2.0

Discussion

  • Logged In: NO

    Actually, there isanother problem that the path to the file
    supplied through read_default_file must be a full path, not
    relative path. It should give me some clear error message
    too. Again it complains with the 2002 error much later.

     
  • Andy Dustman
    Andy Dustman
    2005-11-16

    Logged In: YES
    user_id=71372

    This is a C API feature; MySQLdb does not interpret that
    parameter in any way.