zoukankan      html  css  js  c++  java
  • The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

    导出表格到xls文件,报错:

    mysql> select count(*) into outfile '/tmp/people.xls' from fp_people;

    ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

    查看--secure-file-priv的值,--secure-file-priv值的默认目录是 /var/lib/mysql-files/

    mysql> show variables like '%secure%';

    +--------------------------+-----------------------+

    | Variable_name            | Value                 |

    +--------------------------+-----------------------+

    | require_secure_transport | OFF                   |

    | secure_auth              | ON                    |

    | secure_file_priv         | /var/lib/mysql-files/ |

    +--------------------------+-----------------------+

    3 rows in set (0.00 sec)

    把输出的地址改成/var/lib/mysql-files/,语句执行成功:

    mysql> select count(*) into outfile '/var/lib/mysql-files/people.xls' from fp_people;

    Query OK, 1 row affected (0.01 sec)

    结束。

     

  • 相关阅读:
    ICMPv6 Type 和 rfc
    Redis学习
    Vue学习(一)
    《一线架构师实践指南》读后感(五)
    《一线架构师实践指南》读后感(四)
    Stream流
    泛型
    《架构漫谈》读后感
    《一线架构师实践指南》读后感(三)
    《一线架构师实践指南》读后感(二)
  • 原文地址:https://www.cnblogs.com/liusingbon/p/13043578.html
Copyright © 2011-2022 走看看