Rocky 9.0 Mariadb Save SQL query output to a file

From Notes_Wiki
Revision as of 07:41, 15 October 2022 by Saurabh (talk | contribs) (Created page with "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: <pre> INTO OUTFILE '/tmp/output1.txt'; </pre> '''Note that above file may not be visible in /tmp. You may have to go to /tmp/systemd-private-<uid>-mariadb.service...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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