0

I am attempting to import a text file into a table on MySQL workbench. When I run my 'LOAD DATA INFILE' command, I get this error

Error 120- mysql server is running with the secure-file-priv option

When I looked it up, from what I understood, there's a specific directory from which I can import text files and if the file is outside of this directory, then I'll be getting this error. I figured I look up an answer online, and most people suggested that I run this command

"SHOW VARIABLES LIKE "secure_file_priv".

The problem is, whenever I attempt to run this command, my MySQL tab 'quits unexpectedly'.... wow, just wow. So now Im stuck not being able to find which directory must be used for text files. Any help would be really appreciated.

jarlh
  • 42,561
  • 8
  • 45
  • 63
Moataz Abdelraouf
  • 149
  • 1
  • 4
  • 13
  • odd. `select * from information_schema.SYSTEM_VARIABLES where VARIABLE_NAME='secure_file_priv'` maybe. Which MySQL version? – danblack Jan 31 '23 at 01:43
  • 8.0.32 I believe. I know, I've been trying to get it to work for a min now, and i seem to run into an obstacle at every turn – Moataz Abdelraouf Jan 31 '23 at 02:22
  • @danblack I tried your command, and I got this: Error Code: 1109. Unknown table 'SYSTEM_VARIABLES' in information_schema – Moataz Abdelraouf Jan 31 '23 at 02:25
  • @danblack: I think that table only exists on MariaDB, and not on MySQL ? – Luuk Jan 31 '23 at 07:48
  • @MoatazAbdelraouf: For getting the version you can do: `SELECT version();` – Luuk Jan 31 '23 at 07:49
  • how can I access this 'secure_file_priv' file? – Moataz Abdelraouf Jan 31 '23 at 19:28
  • @MoatazAbdelraouf: It is not a file, but it's a directory but when MySQL quit unexpectedly, you should check the log files. see: [How to see log files in MySQL?](https://stackoverflow.com/questions/5441972/how-to-see-log-files-in-mysql) – Luuk Feb 02 '23 at 07:43

0 Answers0