在mysql中可以使用 select[列名] from table [where 语句] into outfile '目标文件' [option] 将一张表的内容导出到外部文件中。但是
select * from pmx.score into outfile '~/score.sql';
ERROR1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
执行时却报错了。。。好了,问题抛出来,下面开始庖丁解牛。
1.mysql服务可以在没有配置文件的情况下运行,此时系统变量为默认值
使用 "show variables like 变量名" 查看具体变量值
2.MAMP中的mysql是没有配置文件的,全局搜索不到my.cnf
3.
mysqld --verbose --help|grep -A 1 'Default options'
2018-08-03 16:12:17 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.2018-08-03 16:12:17 0 [Note] mysqld (mysqld 5.6.38) starting as process 18398...2018-08-03 16:12:17 18398 [Warning] Setting lower_case_table_names=2 because file system for /Appl