I can not write my query result to local file. I am sure my query produces output. I can view it. I use MySQL workbench on Ubuntu 18.04. After I added this line to write the output to a file:
INTO OUTFILE '/var/lib/mysql-files/myproject/out_files/mydata.txt' FIELDS TERMINATED BY ',';
I get this error:
Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
I looked int previous posts. I made sure that the /var/lib/mysql-files
is the specified path for writing. This is the output I get:
mysql> SELECT @@GLOBAL.secure_file_priv;
+---------------------------+
| @@GLOBAL.secure_file_priv |
+---------------------------+
| /var/lib/mysql-files/ |
+---------------------------+
1 row in set (0.00 sec)
What is the problem?