linux - Why MySQL disable load local infile is not working? -
as part of security hardening, trying disable local_infile , prevent accessing local files of operating system. per documentation can disable either setting variable local-infile=0 in my.cnf or start mysqld service option --local-infile=0. of option able load local files.
i tried first adding in /etc/my.cnf
[mysqld] local-infile=0 after confirmed changes got reflected.
mysql> show global variables 'local_infile'; +---------------+-------+ | variable_name | value | +---------------+-------+ | local_infile | off | +---------------+-------+ 1 row in set (0.00 sec) then mysql client loaded local file using load_file
mysql> select load_file("/etc/passwd"); the above command shows content of /etc/passwd file, though local_infile disabled.can tell going wrong here?
i repeated same steps passing mysqld --local-infile=0 no change. have tried starting mysql client --local-infile=0 option no difference.
use query in mysql database
step:1
show global variables 'local_infile'; step:2
set global local_infile = 'on'; step:3
show global variables 'local_infile';
Comments
Post a Comment