As shown in the code below I want to export my tables to the location in 'secure_file_priv', as it is I just manually copy and paste it but I'd like to be able to just use it's value.
USE Library;
show VARIABLES LIKE 'secure_file_priv';
set mylocation := (VARIABLES LIKE 'secure_file_priv');
SELECT 'Id', 'Name', 'Birthplace', 'Birthday', 'Gender'
UNION ALL
SELECT Id, Name, Birthplace, Birthday, Gender
FROM Author
INTO OUTFILE '/var/lib/mysql-files/author.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY ''
LINES TERMINATED BY '\n';
Instead of manually writing '/var/lib/mysql-files/author.csv' I'd like to be able to use the 'secure_file_priv' variable's value.