PL/MySQL - can't load file
Database
1
Posts
1
Posters
0
Views
1
Watching
-
Good morning from Brazil. I'm running MySQL with root privileges and with the read and write permissions set but I still can't load a file with load_file:
delimiter //
drop procedure if exists sp_loadfile //
create procedure sp_loadfile
(
p_file_name varchar(128)
)
begin
declare my_text text;
set my_text = load_file(p_file_name);
select concat(p_file_name, ' has ', length(my_text), ' bytes.') as 'Output';
end;
//-rw-rw-rw- 1 eduardo eduardo 5 Set 1 11:04 test.txt
mysql> call sp_loadfile('/var/www/mysql/PL_loadfile/test.txt');
+--------+
| Output |
+--------+
| NULL |
+--------+
1 row in set (0.00 sec)