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文件可导入到任意路径

  • 相关阅读:
    2012年浙大:Hello World for U
    noip2011普及组:统计单词
    noip2013提高组:积木大赛
    蓝桥杯:错误票据
    C#知识点
    疑问
    C#多态
    SQLServer导入Excel,复杂操作
    SQLServer数据库基本操作,导入Excel数据
    C#基础学习
  • 原文地址:https://www.cnblogs.com/young233/p/12469780.html
Copyright © 2011-2022 走看看