---
title: MySQL instances should have the 'local_infile' database flag set to 'off'
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > MySQL instances should have the
  'local_infile' database flag set to 'off'
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# MySQL instances should have the 'local_infile' database flag set to 'off'
 
## Description{% #description %}

This rule fails when a Cloud SQL for MySQL instance does not set the `local_infile` database flag to `off`. The flag controls whether the server accepts `LOAD DATA LOCAL` statements, which let a client send local files to the server and carry the security risks described in the MySQL documentation. An instance that does not set the flag fails, because the CIS benchmark treats `local_infile` as on by default and requires an explicit `off`. Flag names and values are compared case-insensitively, and the instance fails if any `local_infile` entry has a value other than `off`. Instances running other database engines are skipped, and an instance with a missing or unspecified database version fails because its engine cannot be determined. A database flag with no name also fails, because it could be `local_infile`.

## Remediation{% #remediation %}

Set the `local_infile` flag to `off` on the flagged instance by following [Configure database flags](https://docs.cloud.google.com/sql/docs/mysql/flags).

## References{% #references %}

- [MySQL local_infile](https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_local_infile)
- [Security considerations for LOAD DATA LOCAL](https://dev.mysql.com/doc/refman/8.4/en/load-data-local-security.html)
- [CIS Google Cloud Platform Foundation Benchmark](https://www.cisecurity.org/benchmark/google_cloud_computing_platform)
