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)

    结束。

     

  • 相关阅读:
    Springboot + Mybatis 多数据源配置
    构建微服务:Spring boot 入门篇
    IDEA SpringBoot代码修改热部署/加载
    vue-cli知识点
    vuex知识点
    正则基本知识
    多行SQL语句拼成一条数据
    软件的版本控制
    ASP.NET 表单验证实现浅析
    建造者模式
  • 原文地址:https://www.cnblogs.com/liusingbon/p/13043578.html
Copyright © 2011-2022 走看看