问题场景 执行导入数据报错 执行语句如下: load data infile 'C:\Users\86183\Desktop\laodInFile.txt' INTO TABLE test.test1; 报错信息如下: 1290
执行导入数据报错
执行语句如下:
load data infile 'C:\Users\86183\Desktop\laodInFile.txt' INTO TABLE test.test1;
报错信息如下:
1290 - The MySQL Server is running with the --secure-file-priv option so it cannot execute this statement
由于secure-file-priv变量的默认设置为/var/lib/Mysql-files/所引起的,该值意味着只能导出到指定目录下(已验证),否则会报错,查看mysql数据库该变量值:
show variables like '%secure%';
secure-file-priv 配置值详解:
(1)secure_file_prive=null,限制mysqld 不允许导入导出
(2)secure_file_priv=/var/lib/mysql-files/,限制mysqld的导入导出只能发生在/var/lib/mysql-files/目录下
(3)secure_file_priv=' ',不对mysqld的导入导出做限制
(1)修改 secure_file_prive 的变量值即可。
打开my.cnf 或 my.ini 文件
secure_file_priv = ''
(2)重启 Mysql 服务
(3)查看变量值
(4)再次执行导入语句,即可成功执行。
来源地址:https://blog.csdn.net/weixin_36754290/article/details/129267205
--结束END--
本文标题: Mysql 1290 - The MySQL server is running with the --secure-file-priv option
本文链接: https://www.lsjlt.com/news/412318.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-16
2024-05-16
2024-05-16
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0