You need both the server and the client to enable local-infile import.
The server needs to enable local_infile=1. You can put this in your my.cnf options file, or you can enable it dynamically on a running server with SET GLOBAL local_infile=1;
You also need to tell the client to allow it. Do this by starting the client:
mysql --local-infile=1 ...
Since MySQL 8.0.19, the error message is more clear:
ERROR 3950 (42000): Loading local data is disabled; this must be
enabled on both the client and server side
See also:
Update: If you use MySQL Workbench instead of the mysql command line client, you can enable local-infile in the options on the Advanced tab of your connection profile. See highlighted line below:

SELECT @@version;- that will tell you the version of the server.