ERROR 1148: The used command is not allowed with this MySQL version(错误 1148:此 MySQL 版本不允许使用的命令)
问题描述
我正在尝试使用
LOAD DATA LOCAL
INFILE A.txt
INTO DB
LINES TERMINATED BY '|';
这个问题的主题是我得到的回应.我知道默认情况下本地数据卸载是关闭的,我必须使用命令 local-infile=1 启用它,但我不知道在哪里放置这个命令.
the topic of this question is the response I get. I understand the local data offloading is off by default and I have to enable it using a the command local-infile=1 but I do not know where to place this command.
推荐答案
您可以在设置客户端连接时将其指定为附加选项:
You can specify that as an additional option when setting up your client connection:
mysql -u myuser -p --local-infile somedatabase
这是因为该功能打开了一个安全漏洞.所以你必须以明确的方式启用它,以防你真的想使用它.
This is because that feature opens a security hole. So you have to enable it in an explicit manner in case you really want to use it.
客户端和服务器都应该启用本地文件选项.否则它不起作用.要为服务器端服务器上的文件启用它,请将以下内容添加到 my.cnf 配置文件:
Both client and server should enable the local-file option. Otherwise it doesn't work.To enable it for files on the server side server add following to the my.cnf configuration file:
loose-local-infile = 1
这篇关于错误 1148:此 MySQL 版本不允许使用的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 1148:此 MySQL 版本不允许使用的命令
基础教程推荐
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- 无法解决整理冲突 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
