having trouble writing to mysqldb