After researching, I was able to create my.cnf
with secure_file_priv
+ path , connect Configuration file to my.cnf and import cvs files using LOAD DATA INFILE.
Here's how I did it:
A. CREATING my.cnf:
- Create
my.cnf
file using text editor
- In my.cnf, input the below and save on folder of choice (ie. Desktop):
[mysqld] secure_file_priv = "/usr/local/”
*When save, untick for If not extension provided, use “.txt” so your "Kind" of file is Document.
- Move my.cnf file to
/etc/
B. IN MYSQL WORKBENCH:
- Tab ADMINISTRATION (top left)
- Click Manage Server Connections (next to INSTANCES, screenshot can be found here)
- Change Installation Type to: macOS (MySQL Package)
- Next to Configuration file > Choose
/etc/my.cnf
- Test Connection to check. If succeed, Close.
- Click Options File under INSTANCES to check if still “...not specified” (it shouldnt be)
- Quit Workbench
- RESTART SERVER by System Preferences > My SQL > Stop Server and then Start Server again
- Open Workbench to check
`
SHOW VARIABLES LIKE 'secure_file_priv';
Expected result:
Variable_Name: secure_file_priv
Value: /usr/local/
`
C. IMPORTING:
- Move my csv file to
/usr/local/
- Use
LOAD DATA INFILE '/usr/local/filename.csv' [...]