mysql数据库-1.文件导入mysql表secure_file_priv报错问题解决 mysql select outfile不能导出亲测
1.問題
Mac系統,將文件導入mysql表中,報錯secure_file_priv選項未設置。
執行導入文件到表mobile_attribute_jxl命令時:
load data infile ‘/home/dm_mobile.txt' into table mobile_attribute_jxl fields terminated by ',' lines terminated by '\n';
報錯:
Error: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
2.解決方案
SHOW VARIABLES LIKE "secure_file_priv”;
發現其值為NULL,此時需要在修改secure_file_priv的設置
secure_file_prive=null ? -- 限制mysqld 不允許導入導出
secure_file_priv=/tmp/ ? -- 限制mysqld的導入導出只能發生在/tmp/目錄下
secure_file_priv='' ? ? -- 不對mysqld 的導入 導出做限制
1.找到 /private/etc/my.cnf
2.在my.cnf中添加加粗部分語句即可
[mysqld]
max_connections=1024
secure_file_priv=''
[mysql]
Default-character-set=utf8mb4
3.重啟mysql服務器
重新導入即可
---------------------?
作者:JackieChen1992?
來源:CSDN?
原文:https://blog.csdn.net/cshichunhua/article/details/78535755?utm_source=copy?
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!
來源:https://blog.csdn.net/cshichunhua/article/details/78535755
總結
以上是生活随笔為你收集整理的mysql数据库-1.文件导入mysql表secure_file_priv报错问题解决 mysql select outfile不能导出亲测的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 社会公德(说一说社会公德的简介)
- 下一篇: MySQL导出数据遇到secure-fi