Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 3114  / 2 Years ago, tue, december 14, 2021, 10:58:01

I am using Ubuntu 13.04 and installed MySQL Server version: 5.5 .



All I want simply , if I doing a MySQL query then its output should have to store in a text file. How can I achieve this ?



for example :



select * from raja


then output of table raja should have to store in a text file along with terminal display.



Thank you.


More From » 13.04

 Answers
7

Like this:



mysql -u username -p -e 'select * from raja;' database_name >> file_name.txt


If you want to append use >> otherwise >.


[#29531] Wednesday, December 15, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dersol

Total Points: 78
Total Questions: 100
Total Answers: 124

Location: Christmas Island
Member since Mon, Oct 19, 2020
4 Years ago
;