MySQL: Enable LOAD DATA LOCAL INFILE

后端 未结 18 1073
北海茫月
北海茫月 2020-11-22 09:30

I\'m running Mysql 5.5 on Ubuntu 12 LTS. How should I enable LOAD DATA LOCAL INFILE in my.cnf?

I\'ve tried adding local-infile in my config at various places but I\'

18条回答
  •  -上瘾入骨i
    2020-11-22 09:37

    From the MySQL 5.5 manual page:

    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”.

    You should set the option:

    local-infile=1
    

    into your [mysql] entry of my.cnf file or call mysql client with the --local-infile option:

    mysql --local-infile -uroot -pyourpwd yourdbname
    

    You have to be sure that the same parameter is defined into your [mysqld] section too to enable the "local infile" feature server side.

    It's a security restriction.

提交回复
热议问题