1.进入mysql查看secure_file_prive的值

$mysql -u root -p

mysql>SHOW VARIABLES LIKE "secure_file_priv";

secure_file_prive=null   -- 限制mysqld 不允许导入导出

secure_file_priv=/tmp/   -- 限制mysqld的导入导出只能发生在/tmp/目录下

secure_file_priv=' '         -- 不对mysqld 的导入 导出做限制

2.更改secure_file_pri的值

/usr/local/mysql/support-files中的my-default.cnf配置文件,就把它复制到/private/etc中,重命名为“my.cnf”,并加入secure_file_priv='',重启mysql服务器即可。

3.导入csv文件

-- sql导入csv文件
load data local infile '/Users/jojo/dumps/train.csv' --文件目录
into table new_table -- 这里导入csv会出错,具体解决方法见"问题解决"
fields terminated by','optionally enclosed by '"' escaped by '"'
-- 字段之间以逗号分隔,字符串以半角双引号包围,字符串本身的双引号用两个双引号表示
lines terminated by'\r\n' -- 数据行之间以\r\n分隔

4.导出csv文件

select * from table_name
into outfile 'C:/ProgramData/MySQL/MySQL Server 5.7/xx.csv'
FIELDS TERMINATED BY ','   
OPTIONALLY ENCLOSED BY '"'   
LINES TERMINATED BY '/n'

Mac上csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option解决办法的更多相关文章

  1. csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方法【转】

    解决方法: 1.进入mysql查看secure_file_prive的值 mysql>SHOW VARIABLES LIKE "secure_file_priv"; secu ...

  2. csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option

    解决方法: 1.进入mysql查看secure_file_prive的值 mysql>SHOW VARIABLES LIKE "secure_file_priv"; secu ...

  3. mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option解决办法

    1.进入mysql查看secure_file_prive的值 $mysql -u root -p mysql>SHOW VARIABLES LIKE "secure_file_priv ...

  4. CodeSign error: code signing is required for product type Application in SDK iOS XXX的解决办法

    转自:http://www.tuicool.com/articles/jYRNbm 在真机测试的时候往往会突然出现这样一个错误,code signing is required for product ...

  5. MySQL使用root用户授权出现错误ERROR 1045 (28000) at line 2: Access denied for user 'root'@'%' (using password: YES)解决办法

    参考:https://blog.csdn.net/open_data/article/details/42873827 使用MySQL的root用户登录出现错误提示 ERROR 1045 (28000 ...

  6. [Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement]错误解决

    1.配置文件中将这行注销“secure-file-priv="C:/ProgramData/MySQL/MySQL Server 5.7/Uploads" ”:很多人添加权限依然不 ...

  7. flume-ng version出现错误Error: Could not find or load main class org.apache.flume.tools.GetJavaPrope的解决办法

    错误: 找不到或无法加载主类 org.apache.flume.tools.GetJavaProperty或者Error: Could not find or load main class org. ...

  8. Mysql Update更新错误 Error Code:1175

    Mysql 5.7,默认执行 update 语句时遇到错误提示: Error Code: 1175. You are using safe update mode and you tried to u ...

  9. mac上Navicat新建数据库3680错误解决办法

    mac上Navicat新建数据库3680错误解决办法 1.在设置里关闭mysql,若不能关闭,在终端输入: sudo /usr/local/mysql/support-files/mysql.serv ...

随机推荐

  1. [转]oracle存储过程中update不成功的一个原因

    原文地址:http://lin49940.iteye.com/blog/466626 今天一个同事写oracle 的存储过程遇到了一个问题, 他在里面update 操作不能完成更新的操作, 但是又不会 ...

  2. (转载)WPF中的动画——(一)基本概念

    http://www.cnblogs.com/TianFang/p/4050845.html WPF的一个特点就是支持动画,我们可以非常容易的实现漂亮大方的界面.首先,我们来复习一下动画的基本概念.计 ...

  3. Python对字典(directory)按key和value排序

    distance = {9149: 0, 9150: 26, 9151: 24, 9152: 24, 9153: 24, 9154: 27, 9155: 25, 9156: 30, 9158: 20, ...

  4. [TestLink]testlink安装

    转自:http://www.51testing.com/html/25/465025-3711140.html bitnami参考:https://bitnami.com/stack/testlink ...

  5. 图像颜色--opencv scalar

    Scalar定义可存放1—4个数值的数值,其结构体如下: typedef struct Scalar { double val[4]; }Scalar; 例如:Scalar s: 如果使用的图像是1通 ...

  6. spring boot微服务改造冲突

    1.报错: 13:57:49.959 [main] ERROR org.springframework.boot.SpringApplication - Application startup fai ...

  7. Android训练课程(Android Training) - 测试你的Android Activity

    你应该开始编写和启动测试作为你的android程序开发周期的一部分.写的好的测试能够帮助你更早的发现bug和使你对你的代码有信心. 一个测试用例定义了一些对象和方法的集合,用于启动多样的彼此独立的测试 ...

  8. git push报错:error: RPC failed; result=22, HTTP code = 413

    新项目推送到服务器时报错: error: RPC failed; result=22, HTTP code = 413| 7.66 MiB/s    fatal: The remote end hun ...

  9. JSP字符集编码集合

    在这里,我们先说说JSP/Servlet中的几个编码的作用. 在JSP/Servlet 中主要有以下几个地方可以设置编码,pageEncoding="UTF-8".contentT ...

  10. JSP之Cookie对象使用

    1.写入Cookie //如果用户勾选一个月内自动登录,则将信息保存至Cookie String[] strings=request.getParameterValues("autoLogi ...