尝试使用 into outfile导出数据的时候出现错误:

The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

方法一:查看本地允许导出目录

mysql>SHOW VARIABLES LIKE "secure_file_priv";

 C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ 

mysql> select * from tncl where tncl_id regexp'^0065' into outfile 'C:\\ProgramData\\MySQL\\MySQL Server 5.7\\Uploads\\test123.csv';

方法二:自定义修改导出目录

问题是mysql设置的权限,可以使用

show variables like '%secure%';查看 secure-file-priv 当前的值是什么

导出的数据必须是这个值的指定路径才可以导出,默认有可能是NULL就代表禁止导出,所以需要设置一下

知道mysql安装路径下的my.ini文件,设置一下路径:

然后重启数据库即可;

Windows sql语句正则匹配导出数据到本地 The MySQL server is running with the --secure-file-priv option so it cannot execute this statement的更多相关文章

  1. 使用sql语句比较excel中数据的不同

    使用sql语句比较excel中数据的不同 我所在的项目组是一套物流系统,负责与公司的电商系统进行对接.但是公司的电商系统的省市区的配置和物流系统的省市区的配置有差异,所以需要找到这些差异. 首先找到我 ...

  2. sql语句中----删除表数据drop、truncate和delete的用法

    sql语句中----删除表数据drop.truncate和delete的用法 --drop drop table  tb   --tb表示数据表的名字,下同 删除内容和定义,释放空间.简单来说就是把整 ...

  3. 【转载】SQL语句将一个表的数据写入到另一个表中

    在日常的数据库运维过程中,有时候需要将Select查询出来的数据集写入到另一个数据表中,其中一种方式是通过存储过程循环写入数据,另一种简便的方式是直接使用Insert Into语句后面跟上Select ...

  4. MySql 执行语句错误 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    关于用Power Designer 生成sql文件出现 错误  [Err] 1064 - You have an error in your SQL syntax; check the manual ...

  5. 插入mysql语句报错:1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near

    插入一个很简单的sql语句时候,mysql一直报错: [SQL] INSERT INTO ORDER ( id, activity_id, order_type, phone, order_amoun ...

  6. C# Mysql You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ????

    有几年没用过MySql数据了,今天在使用C#访问MySql数据库时出现了一个小插曲. 错误提示: You have an error in your SQL syntax; check the man ...

  7. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups)VALUES('1','hh','hh@163.com','Boss')' at line 1

    mysql8.0版本 在已存在的表里插入一条数据 insert INTO api_user(id,username,email,groups)VALUES('1','hh','hh@163.com', ...

  8. MYSQL导入CSV格式文件数据执行提示错误(ERROR 1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement.

    MYSQL导入CSV格式文件数据执行提示错误(ERROR 1290): The MySQL server is running with the --secure-file-priv option s ...

  9. MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...

    下面是我update数据库时打印出来的异常: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSynt ...

随机推荐

  1. 使用ndk-stack来查找崩溃

    logcat报错 Fatal signal 6 (SIGABRT) at 0x000025c9 (code=-6), thread 9703 (Thread-1277) 都是一些寄存器以及函数地址,真 ...

  2. emacs之配置etags

    emacsConfig/etags-setting.el (require 'auto-complete-etags) (setq ac-sources (append '(ac-source-eta ...

  3. Android中如何使用JUnit进行单元测试 eclipse

    Android中如何使用JUnit进行单元测试 在我们日常开发android app的时候,需要不断地进行测试,所以使用JUnit测试框架显得格外重要,学会JUnit可以加快应用的开发周期. Andr ...

  4. UI“三重天”之selenium--常用API和问题处理(三)

    Selenium常用API: 前面两篇示例代码中用到了一些selenium的API方法,例如定位元素的八种方法.访问url.等待.操作浏览器.获取title.点击.清理等等. 有关于selenium的 ...

  5. 0122(本来是想ak的但是因为智障只拿了200。)

    今天考了一场小测试,额,非常非常水,但是智障的我才A掉两道题. T1: 1.暑假作业   (mtime.pas/c/cpp) [问题描述] 暑假作业是必须要写的,越到假期结束前,写作业的效率就越高,小 ...

  6. Linux下分析某个进程CPU占用率高的原因

      Linux下分析某个进程CPU占用率高的原因 通过top命令找出消耗资源高的线程id,利用strace命令查看该线程所有系统调用  1.top 查到占用cpu高的进程pid 2.查看该pid的线程 ...

  7. 深入浅出 Java Concurrency (5): 原子操作 part 4 CAS操作

    在JDK 5之前Java语言是靠synchronized关键字保证同步的,这会导致有锁(后面的章节还会谈到锁). 锁机制存在以下问题: (1)在多线程竞争下,加锁.释放锁会导致比较多的上下文切换和调度 ...

  8. maven学习系列 之 常见问题

    1.新建的maven项目无法修改 Project Facets 的 Dynamic Web Module 版本 RE: 在工程目录下有一个.settings文件夹,打开org.eclipse.wst. ...

  9. We could not complete your iTunes Store request

    We could not complete your iTunes Store request.An unknown error occurred(502). There was an error i ...

  10. Firefox 被Snap.do 劫持

    Firefox IE 被劫持 windows的控制面板,卸载程序, 找任何跟「Snap.do」有关的软件,找到後先移除「Snap.Do Engine」再移除「Snap.Do」. 注册表里查找 Snap ...