Disable secure priv for data loading on MySQL
Getting error while output file to cdv from a select
mysql> SELECT VERSION(); +-----------+ | VERSION() | +-----------+ | 5.7.13 | +-----------+ 1 row in set (0,00 sec) mysql> SELECT @@GLOBAL.secure_file_priv; +---------------------------+ | @@GLOBAL.secure_file_priv | +---------------------------+ | NULL | +---------------------------+ 1 row in set (0,00 sec) -- USE ... mysql> SELECT * FROM customer WHERE createdate = '2021-01-01' ORDER BY c1.time_stamp DESC, c1.id DESC INTO OUTFILE '/var/www/html/2021-01.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'; ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Tagged:
0
Comments
-
edit `vi /etc/my.cnf` and add
[mysqld] secure_file_priv=""
After
service mysqld restart
0
Howdy, Stranger!
Categories
- 94 All Categories
- 20 VoIP
- 7 SIP
- 16 asterisk
- 44 Programming
- 1 Nodejs
- 4 javascript
- 19 PHP
- 8 Codeigniter
- 14 database
- 1 UI/UX
- 2 Flutter
- 28 OS
- 26 Linux
- 1 Virtualization
- 1 Android
- 1 Windows
- 2 legal