Here's what I found so far.
It appears that error is triggered when opening a connection, at MySQLdb.Connect(...)
, 2nd line in pasted code, not when closing a connection.
Full backtrace:
- ...
- execute_sql_query [op]
- MySQLdb Connect [op]
- MySQLdb super(...) [op]
- _mysql.c ConnectionObject_Initialize [lower level pyhon module, written in C]
- libmysql mysql_real_connect or mysql_options [probably the earlier]
- fails, exception is set
Let's decode the exception
InternalError:
(3,
"Error writing file 'D:\\MySQL_Datafiles\\Logfiles\\query.log'
(Errcode: 9)")
- "3" older mysql mysys_err.h
EE_WRITE
3 - "query.log", is this local or remote log file? appears to be a windows path.
- "Errorcode: 9" assuming windows (above), that is
ERROR_INVALID_BLOCK
"The storage control block address is invalid." Quite cryptic, but it'd go and check if this file exist, if it is writeable, and if it may be subject to logrotate or similar. Check disk space, for a good measure, do a disk check as well.
It appears to be a client-side error. Please check your client-side my.cnf
, [client]
section.