Mysql – –local-infile=1 using MySQL Workbench

MySQLmysql-workbench

When I start the MySQL bash client, I have been starting it with --local-infile=1 so that I can import data from a .csv file.

Is there any way of doing this within MySQL Workbench?

Best Answer

According to the MySQL Documentation on LOAD DATA INFILE

For security reasons, when reading text files located on the server, the files must either reside in the database directory or be readable by all. Also, to use LOAD DATA INFILE on server files, you must have the FILE privilege. See Section 6.2.1, “Privileges Provided by MySQL”. For non-LOCAL load operations, if the secure_file_priv system variable is set to a nonempty directory name, the file to be loaded must be located in that directory.

As long as you have FILE privilege, you can do this in SQL Editor

SET GLOBAL local_infile = 1;