- 在mysql配置文件/etc/my.cnf中[mysqld]配置段添加以下配置
[mysqld]
...
secure_file_priv=''
...
- 重啓mysql並再次查看secure_file_priv的值
# /etc/init.d/mysqld restart
#
mysql> show global variables like '%secure%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | |
+--------------------------+-------+
3 rows in set (0.00 sec)
- 再次執行導入操做,成功
mysql> load data infile '/mnt/test/20190220/test_eventHistory_2019022000_2019022023.txt' into table event_history_201902(json_str);
Query OK, 234 rows affected (0.00 sec)