mysql导出表后找不到文件_mysql无法导出表内容

在MAMP环境中,由于MySQL服务器运行在--secure-file-priv选项下,导致无法执行表内容导出。通过查看系统变量发现secure_file_priv为NULL,需创建my.cnf配置文件,设置该变量为特定路径,然后重启mysqld服务使配置生效。
摘要由CSDN通过智能技术生成

在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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值