Security Considerations for LOAD DATA LOCAL For control over local data loading, MySQL permits the capability to be enabled or disabled. In addition, as of MySQL 8.0.21, MySQL enables clients to restrict local data loading operations to files located in a designated directory. Adminstrators and applications can configure whether to permit local data loading as follows: or: 1179 [client] loose-local-infile=0 •If you use  LOAD DATA LOCAL  in Perl scripts or other programs that read the  [client]  group from option files, you can add a  local-infile  option setting to that group. To prevent problems for programs that do not understand this option, specify it using the  loose-  prefix: •For the  mysqlimport  client, local data loading is not used by default. To disable or enable it explicitly, use the  --local=0  or  --local[=1]  option. •For the  mysql  client, local data loading capability is determined by the default compiled into the MySQL client library. To disable or enable it explicitly, use the  --local-infile=0  or  --local- infile[=1]  option. •For client programs that use the C API, local data loading capability is determined by the default compiled into the MySQL client library. To enable or disable it explicitly, invoke the mysql_options() C API function to disable or enable the  MYSQL_OPT_LOCAL_INFILE  option. See mysql_options(). •By default, the client library in MySQL binary distributions is compiled with  ENABLED_LOCAL_INFILE disabled. If you compile MySQL from source, configure it with  ENABLED_LOCAL_INFILE  disabled or enabled based on whether clients that make no explicit arrangements should have  LOCAL  capability disabled or enabled. •The  ENABLED_LOCAL_INFILE CMake  option controls the compiled-in default  LOCAL  capability for the MySQL client library (see Section 2.9.7, “MySQL Source-Configuration Options” ). Clients that make no explicit arrangements therefore have  LOCAL  capability disabled or enabled according to the ENABLED_LOCAL_INFILE  setting specified at MySQL build time. •On the client side: •By default,  local_infile  is disabled. To explicitly cause the server to refuse or permit  LOAD DATA LOCAL  statements (regardless of how client programs and libraries are configured at build time or runtime), start  mysqld  with  local_infile  disabled or enabled.  local_infile  can also be set at runtime. •The  local_infile  system variable controls server-side  LOCAL  capability. Depending on the local_infile  setting, the server refuses or permits local data loading by clients that request local data loading. •On the server side: Enabling or Disabling Local Data Loading Capability •MySQL Shell and Local Data Loading •Restricting Files Permitted for Local Data Loading •Enabling or Disabling Local Data Loading Capability