Home > Database > Mysql Tutorial > How to Enable LOAD DATA LOCAL INFILE in MySQL?

How to Enable LOAD DATA LOCAL INFILE in MySQL?

Mary-Kate Olsen
Release: 2024-12-12 22:46:14
Original
636 people have browsed it

How to Enable LOAD DATA LOCAL INFILE in MySQL?

Enable LOAD DATA LOCAL INFILE in MySQL

Problem:

How to enable LOAD DATA LOCAL INFILE in the MySQL configuration file (my.cnf) for MySQL 5.5 on Ubuntu 12 LTS.

Solution:

To enable LOAD DATA LOCAL INFILE, you need to add the following option to the [mysql] section of your my.cnf file:

local-infile=1
Copy after login

Alternatively, you can call the MySQL client with the --local-infile option:

mysql --local-infile -uroot -pyourpwd yourdbname
Copy after login

You can also set the global variable at runtime with the following query:

SET GLOBAL local_infile=ON;
Copy after login

Additional Note:

Ensure that the local-infile parameter is also defined in the [mysqld] section of the my.cnf file to enable the "local infile" feature server-side. This restriction is in place for security reasons.

The above is the detailed content of How to Enable LOAD DATA LOCAL INFILE in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template