I am learning MySQL and tried using a LOAD DATA
clause. When I used it as below:
LOAD DATA INFILE \"text.txt\" INTO table mytable;
This worked for me (had the additional problem of not being able to use LOCAL with my current MySQL version in the statement LOAD DATE INFILE ... )
sudo /usr/local/mysql/support-files/mysql.server start --secure-file-priv='' --local-infile
The above works for that given path on my machine; you may have to adjust your path.
Then use:
mysql -u root -p
One important point is that you should have the CSV in the MySQL data folder. In my machine it is located at: /usr/local/mysql-8.0.18-macos10.14-x86_64/data
You can change the folder permission if needed to drop a CSV in the data folder.
Setup:
macOS Catalina version 10.15.5
MySQL version 8.0.18