
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Enable LOAD DATA LOCAL INFILE in My.cnf in MySQL
We can enable it with the help of the SET command with GLOBAL. The first time, local infile will be off.
The following is the syntax.
mysql> SHOW GLOBAL VARIABLES LIKE 'local_infile';
Here is the output.
+---------------+-------+ | Variable_name | Value | +---------------+-------+ | local_infile  | OFF | +---------------+-------+ 1 row in set (0.01 sec)
We can enable the local infile with the help of ON or boolean value true or numeric value 1. The following is the syntax to enable the local infile.
mysql> SET GLOBAL local_infile = 'ON'; Query OK, 0 rows affected (0.00 sec) mysql> SET GLOBAL local_infile = 1; Query OK, 0 rows affected (0.00 sec) mysql> SET GLOBAL local_infile = true; Query OK, 0 rows affected (0.00 sec)
In MySQL version 8.0.12, let us check if it is ON or not.
mysql> Â SHOW GLOBAL VARIABLES LIKE 'local_infile';
The following is the output.
+---------------+-------+ | Variable_name | Value | +---------------+-------+ | local_infile  | ON | +---------------+-------+ 1 row in set (0.00 sec)
After restarting MySQL, it will set local infile to ON.
Advertisements