Rocky 9.0 Mariadb Save SQL query output to a file

From Notes_Wiki

Home > Rocky Linux or CentOS > Rocky Linux 9.x > Database servers > Mariadb > Save SQL query output to a file

To save SQL query output to a file append the SQL query with:

  INTO OUTFILE '/tmp/output1.txt';

Note that above file may not be visible in /tmp. You may have to go to /tmp/systemd-private-<uid>-mariadb.service-<random-chars>/tmp folder to see the output file.


Refer:


Home > Rocky Linux or CentOS > Rocky Linux 9.x > Database servers > Mariadb > Save SQL query output to a file