mysql - Failed to normalize the argument for --secure-file-priv -


i need execute load_file() statement. documentation tells me secure_file_priv has disabled setting "" or should set path. if not, load_file() return null.

when edit my.cnf , set variable in mysqld-group "", can restart mariadb without problems. if set variable path (secure_file_priv="/path/", following output:

> sudo systemctl restart mariadb.service job mariadb.service failed because control process exited error code. see "systemctl  status mariadb.service" , "journalctl  -xe" details.  > sudo systemctl  status mariadb.service mariadb.service - mariadb 10.1 database server    loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)    active: failed (result: exit-code) since tue 2017-09-12 10:50:59 cest; 13s ago   process: 4815 execstartpost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/success)   process: 5306 execstart=/usr/libexec/mysqld --basedir=/usr $mysqld_opts $_wsrep_new_cluster (code=exited, status=1/failure)   process: 5271 execstartpre=/usr/libexec/mysql-prepare-db-dir mariadb.service (code=exited, status=0/success)   process: 5249 execstartpre=/usr/libexec/mysql-check-socket (code=exited,         status=0/success)  main pid: 5306 (code=exited, status=1/failure)    status: "mariadb server down"  sep 12 10:50:57 bel002.home systemd[1]: starting mariadb 10.1 database server... sep 12 10:50:58 bel002.home mysql-prepare-db-dir[5271]: database mariadb initialized in /var/lib/mysql already, nothing done. sep 12 10:50:59 bel002.home mysqld[5306]: 2017-09-12 10:50:59 139800931358976 [warning] failed normalize argument --secure-file-priv. sep 12 10:50:59 bel002.home mysqld[5306]: 2017-09-12 10:50:59 139800931358976 [error] aborting sep 12 10:50:59 bel002.home systemd[1]: mariadb.service: main process exited, code=exited, status=1/failure sep 12 10:50:59 bel002.home systemd[1]: failed start mariadb 10.1 database server. sep 12 10:50:59 bel002.home systemd[1]: mariadb.service: unit entered failed state. sep 12 10:50:59 bel002.home systemd[1]: mariadb.service: failed result 'exit-code'. 

i have executed "chmod 777 /path/". if set secure_file_priv "", select load_file("file name") still returns null.

how can disable secure_file_priv?

ben

i can't reproduce problem:

mariadb [(none)]> select version(); +-----------------+ | version()       | +-----------------+ | 10.1.26-mariadb | +-----------------+ 1 row in set (0.00 sec)  mariadb [(none)]> show variables     -> variable_name = 'secure_file_priv'; +------------------+-------+ | variable_name    | value | +------------------+-------+ | secure_file_priv |       | +------------------+-------+ 1 row in set (0.00 sec)  mariadb [(none)]> \! bash 
$ vi /etc/mysql/my.cnf  [mysqld] ... secure_file_priv = /path/ ...  $ service mysql restart  $ mkdir /path/  $ vi /path/file.name  $ ll /path/file.name -rw-r--r-- 1 mysql mysql /path/file.name  $ exit 
mariadb [(none)]> show variables     -> variable_name = 'secure_file_priv'; +------------------+--------+ | variable_name    | value  | +------------------+--------+ | secure_file_priv | /path/ | +------------------+--------+ 1 row in set (0.00 sec)  mariadb [(none)]> select load_file('/path/file.name'); +------------------------------+ | load_file('/path/file.name') | +------------------------------+ | hello mariadb!               | +------------------------------+ 1 row in set (0.00 sec) 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -