美文网首页
MySQL导出数据遇到secure-file-priv问题的解决

MySQL导出数据遇到secure-file-priv问题的解决

作者: ac619467fef3 | 来源:发表于2018-09-07 23:30 被阅读47次

    lsecure-file-priv

    mysql> load data infile '/home/shop_info.txt' into table shop_info;
    ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
    

    show variables like '%secure%';
    查看信息

    mysql> show variables like '%secure%';
    +------------------+-----------------------+
    | Variable_name    | Value                 |
    +------------------+-----------------------+
    | secure_auth      | ON                    |
    | secure_file_priv | /var/lib/mysql-files/ |
    +------------------+-----------------------+
    2 rows in set (0.00 sec)
    

    将文件mv到/var/lib/mysql-files/文件夹下,再次执行成功。

    load data插入数据NULL

    指定文件分割符

    load data infile "/var/lib/mysql-files/shop_info.txt" into table shop_info  \
    fields terminated by ',';
    

    相关文章

      网友评论

          本文标题:MySQL导出数据遇到secure-file-priv问题的解决

          本文链接:https://www.haomeiwen.com/subject/cxhziftx.html