I am trying to use OUTFILE on Ubuntu 20.04 and getting this error: MySQL server version: 8.0.21
Code:
mysql> select * into OUTFILE '/home/yash/Desktop/data2.txt' from ticket;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
I tried many solutions but it didn't work on Ubuntu 20.04
If anyone can give a solution for Ubuntu 20.04 and MySQL 8.0.21 then it will be appreciated.
As per your question you want to store the result of the query in a text file try '
tee
' MySQL command Try this in your MySQL promptAre you using any shell script or connecting MySQL DB from the terminal?
If not working then disable "
secure_file_priv
" inmysqld.cnf
then restart. setsecure-file-priv = ""
inmysqld.cnf
file and the checkSHOW VARIABLES LIKE "secure_file_priv";
and you get the below sample output