第一步
mysql> show variables like '%local%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile | OFF |
+---------------+-------+
1 row in set, 1 warning (0.00 sec)
mysql>
第二步
mysql> set global local_infile = 'on';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%local%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| local_infile | ON |
+---------------+-------+
1 row in set, 1 warning (0.00 sec)
mysql>
第三步
C:\Users\13405>mysql --local_infile=1 -u root -p
Enter password: ****
第四步
mysql> load data local infile 'f:\pet.txt' into table pet;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Deleted: 0 Skipped: 0 Warnings: 0
mysql> exit