zoukankan      html  css  js  c++  java
  • mysql --secure_file_priv的设置

    最近常需要将大表导出为csv格式,在使用select * into outfile xxx的时候,就会出现此报错。
     

    [Code: 1290, SQL State: HY000] The MySQL server is running with the –secure-file-priv option so it cannot execute this statement

     
    这时候可以先检查这个参数的值,在mysql数据库中输入以下命令:

    show variables like ‘%secure_file_priv%’;
    

     
    然后就可以看到:
     

    默认的路径是/var/lib/mysql-files

    如果要想修改此路径的话,只能通过修改启动时添加特定参数或者修改配置文件后重启服务来实现。

     

    1. 启动时添加特定参数。可通过mysqld -secure-file-priv=xxx来实现。
       

    2. 修改配置文件后重启。可以在mysql配置文件中mysqld选项下添加参数**secure-file-priv来实现。

     
    其中,如果:
    secure_file_priv=null 不允许csv文件的导入导出
     
    secure_file_priv=xxx csv文件导入导出到某路径
     
    secure_file_priv=/ csv文件可导入到任意路径

  • 相关阅读:
    改造二叉树
    汽车加油行驶问题
    [SHOI2012]回家的路
    子串
    P3558 [POI2013]BAJ-Bytecomputer
    HDU
    UVALive
    ZOJ
    HDU
    牛客小白月赛2 题解
  • 原文地址:https://www.cnblogs.com/young233/p/12469780.html
Copyright © 2011-2022 走看看