Skip to main content

Can I use OUTFILE in Managed MySQL?

Yes it's possible on Elestio. Since we are running inMySQL inside a docker container you will have to modify the stack to mount a new volume in the docker-compose. You can edit it with UPDATE CONFIG button from our dashboard

You will have to add a line like this in the mysql container
        - ./files:/var/lib/mysql-files

image.png

Then click on the button "Apply & restart"

After that you can use queries like this:

SELECT * FROM `help_topic` INTO OUTFILE '/var/lib/mysql-files/test1.csv';

and your file test1.csv will be present on the host vm in /opt/app/files/test1.csv

You can access it over SSH / SFTP / File Explorer / VS Code ...