Mac上csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option解决办法
2017-03-04 16:03
1416 查看
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'
$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'
相关文章推荐
- csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方法【转】
- Mac上csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option
- csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option 解决方
- mysql导出表到CSV文件方法及提示错误[Err] 1290 - The MySQL server is running with the --secure-file-priv option解决办法
- [Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement]错误解决
- csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option
- Error Code: 1290. The MySQL server is running with the --secure-file-priv option
- MYSQL 5.7报错 Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it..
- MySQL 报错Error Code: 1290. The MySQL server is running with the --secure-file-priv option
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
- Windows下MySQL导入csv文件ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv opti
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- The MySQL server is running with the --secure-file-priv option so it cannot execute this statement解决
- Windows10 MySQL5.7.21.0 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-p解决办法
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- The MySQL server is running with the --secure-file-priv option so it cannot execute this statement解决
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- mysql导入数据 提示 The MySQL server is running with the --secure-file-priv