mysql--secure-file-priv及“ERROR 13 (HY000): Can't get stat of 问题macbook
2018-02-05 10:33
1261 查看
生产环境
mac问题描述一
很多时候我们需要将文件导入mysql数据库一般的命令是:load data infile '/Users/user/Desktop/test.txt' into table train_data;
注意文件中的列和数据库列应当匹配!
但是这样话会报错:
--secure-file-priv
问题原因
原因是:mysql为了安全考虑需要指定一个文件夹去装载你要载入的文件,但是默认的mysql是没有指定的(不指定即为不允许载入文件。解决方法
我们去修改一下mysql的配置:cd /usr/local/mysql/support-files
这里面有一个my.cnf文件
我们编辑一下
sudo vi my.cnf //请确保您熟知vi编辑器基础操作命令
在末尾加上
secure_file_priv= "/Users/user/xxx" //引号内是你指定的文件夹,mysql将允许这个文件夹下的文件载入mysql
然后保存退出。
注意!这还没结束
这样改完后重启将仍没有效果。
您需要:将my.cnf的副本移动到/private/etc中
cp my.cnf /private/etc/my.cnf
下面重启mysql即可!
随后我们执行不再报
--secure-file-priv
但是会有另一个…
ERROR 13 (HY000): Can't get stat of
问题原因
这是因为你需要指定该文件是“本地的”,要在原来的命令上加入local修饰,即采用一下命令:load data local infile '/Users/frankdura/Desktop/test.txt' into table train_data;
相关文章推荐
- mysql使用load命令 报错:ERROR 13 (HY000): Can't get stat of '/root/mysql/mysql/data/datatotestproc' (Errco
- 如何解决mysqlimport: Error: 13, Can't get stat of 的问题
- load data infile出现“ERROR 13 (HY000): Can't get stat of
- MySQL 报错 ERROR 1290 (HY000): running with the --secure-file-priv
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it ...statemet
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
- MySQL: ERROR13(HY000):Can't get stat of的问题
- MySQL into outfile 问题解决:ERROR 1 (HY000): Can't create/write to file
- 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
- ubuntu 下Mysql导入导出文件报错:ERROR 1290 (HY000): --secure-file-priv
- mysql 导出数据到文件 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so
- mysqldump: Got error: 1290: The MySQL server is running with the --secure-file-priv option so it can
- mysqlimport: Error: 13, Can't get stat of '/root/xiaoming/import.data' (Errcode: 13), when using tab
- MySQL: ERROR13(HY000):Can't get stat of的问题
- 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
- centos下mysql问题记录--ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/