問(wèn)題描述
我在 Ubuntu 12 LTS 上運(yùn)行 Mysql 5.5.我應(yīng)該如何在 my.cnf 中啟用 LOAD DATA LOCAL INFILE?
I'm running Mysql 5.5 on Ubuntu 12 LTS. How should I enable LOAD DATA LOCAL INFILE in my.cnf?
我已經(jīng)嘗試在我的配置中的各個(gè)地方添加 local-infile,但我仍然收到此 MySQL 版本不允許使用的命令"
I've tried adding local-infile in my config at various places but I'm still getting the "The used command is not allowed with this MySQL version"
推薦答案
來(lái)自 MySQL 5.5 手冊(cè)頁(yè):
From the MySQL 5.5 manual page:
LOCAL 僅在您的服務(wù)器和客戶端都已配置為允許它.例如,如果 mysqld 以--local-infile=0, LOCAL 不起作用.請(qǐng)參見(jiàn)第 6.1.6 節(jié)LOAD DATA LOCAL 的安全問(wèn)題".
LOCAL works only if your server and your client both have been configured to permit it. For example, if mysqld was started with --local-infile=0, LOCAL does not work. See Section 6.1.6, "Security Issues with LOAD DATA LOCAL".
您應(yīng)該設(shè)置選項(xiàng):
local-infile=1
進(jìn)入 my.cnf 文件的 [mysql] 條目或使用 --local-infile 選項(xiàng)調(diào)用 mysql 客戶端:
into your [mysql] entry of my.cnf file or call mysql client with the --local-infile option:
mysql --local-infile -uroot -pyourpwd yourdbname
您必須確保在您的 [mysqld] 部分中也定義了相同的參數(shù),以啟用本地 infile"功能服務(wù)器端.
You have to be sure that the same parameter is defined into your [mysqld] section too to enable the "local infile" feature server side.
這是一個(gè)安全限制.
這篇關(guān)于MySQL:啟用 LOAD DATA LOCAL INFILE的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!