Try setting path to /var/lib/mysql-files/filename.csv
(MySQL 8). Determine what files directory is yours by typping SHOW VARIABLES LIKE "secure_file_priv";
in mysql client command line.
See answer about here: (...) --secure-file-priv in MySQL answered in 2015 by vhu user