sqlmapproject/sqlmap · error · NotSupportedError

LOCAL INFILE is not supported

Error message

LOCAL INFILE is not supported

What it means

Error "LOCAL INFILE is not supported" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/mysql.py:212

    def _query(self, query):
        _send_packet(self._sock, 0, b"\x03" + query.encode("utf-8"))  # COM_QUERY
        try:
            return self._read_query_response()
        except (struct.error, IndexError, ValueError) as ex:
            raise InterfaceError("malformed server response: %s" % ex)

    def _read_query_response(self):
        seq, payload = _read_packet(self._sock)
        first = _u8(payload, 0)

        if first == 0xff:  # ERR
            raise ProgrammingError("(remote) %s" % _err_message(payload))
        if first == 0x00 or (first == 0xfe and len(payload) < 9):  # OK packet (no result set)
            affected, _ = _lenc_int(payload, 1)
            return None, [], (affected if affected is not None else -1)
        if first == 0xfb:  # LOCAL INFILE request
            raise NotSupportedError("LOCAL INFILE is not supported")

        column_count, _ = _lenc_int(payload, 0)
        description, binary = [], []
        for _ in range(column_count):
            _, cpay = _read_packet(self._sock)
            off = 0
            for _ in range(4):  # catalog, schema, table, org_table
                _, off = _lenc_str(cpay, off)
            name, off = _lenc_str(cpay, off)          # name
            _, off = _lenc_str(cpay, off)             # org_name
            _, off = _lenc_int(cpay, off)             # length of the fixed-length block (0x0c)
            charset = struct.unpack("<H", cpay[off:off + 2])[0]
            col_type = _u8(cpay, off + 6)             # fixed block: charset(2) column_length(4) type(1) flags(2) ...
            description.append((name.decode("utf-8", "replace"), col_type, None, None, None, None, None))
            binary.append(charset == _BINARY_CHARSET and col_type in _BINARY_TYPES)

        _read_packet(self._sock)  # EOF after the column definitions

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/mysql.py:212 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/78f7b53a5bee49b1. Report an issue: GitHub.