My understanding is that exporting a file (e.g. csv) from MariaDB
is restricted to specified folders by default. Thus, I have been accessing my exported files at the tmp
folder so far. I wanted to ask if there was a way to change this to another folder i.e. /home/user/projects
? I am using Raspbian Stretch as my OS. As a root user of my SQL databas
e, I checked that I have full grant privileges.
+---------------------------------------------------------------------+
| Grants for root@localhost |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION |
+---------------------------------------------------------------------+
However, when I query with
MariaDB [mydatabase]> SELECT * from table1 into outfile '/home/user/projects/file1.csv';
, I get this error:
ERROR 1 (HY000): Can't create/write to file '/home/user/projects/file1.csv' (Errcode: 13 "Permission denied")
,
Is there something else I can do to be able to export my files to a folder of my choosing?
Updates: So far, I tried chmod 755 and 777 methods and creating a new user in the SQL client with granting of full privileges and file (and then logging in as that user to make the query), but have had no success .