mysql导出数据报错The MySQL server is running with the --secure-file-priv option so it cannot execute this

2022/9/11 2:23:23

本文主要是介绍mysql导出数据报错The MySQL server is running with the --secure-file-priv option so it cannot execute this,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

MySQL导出文件时,遇到报错“The MySQL server is running with the --secure-file-priv option so it cannot execute this statement”,网上搜索解决方案,各大神方案相同,

第一步:show variables like '%secure%';

图一

第二步:打开MySQL安装路径,找到my.ini配置文件,搜索 secure,

图二:找到这里,修改路径(原来的最好是注释掉,不要删除),

重启MySQL服务, 就能正常导出到修改后的路径了,但是我依然失败了,报错还是“The MySQL server is running with the --secure-file-priv option so it cannot execute this statement”,又看了几篇博客,都是一样的思路,问题应该出在我自己身上了,自己检查了操作流程,终于找到了原因,修改路径时,由于嫌手动输入路径麻烦,我是直接复制的路径,从下图里复制的路径:
图三:

 

导出时用的也是这个路径,加上一个文件名,结果就是继续报错,

(注意斜杠)

图一、图三显示的是反斜杠,我复制的路径也是用的反斜杠,但是图二配置文件中,用的是斜杠,我导出的文件路径用的也是反斜杠,因此导致失败,把图二中修改的路径改成斜杠,导出路径也用斜杠,导出成功!希望其他小伙伴不要再犯同样的错误!

 

 

转 :https://blog.csdn.net/qq_34172340/article/details/83870035

https://blog.csdn.net/zhuyunier/article/details/88707634

 



这篇关于mysql导出数据报错The MySQL server is running with the --secure-file-priv option so it cannot execute this的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程