LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-10-2003, 12:31 AM   #1
saravanan1979
Member
 
Registered: Jan 2002
Posts: 163

Rep: Reputation: 30
Exporting MYSQL results into a external files


Hello,
Can anyone please tell me how to import the results of MYSQl query to a external file..I have tried

mysql> MYSQL query tee <external file>

but this does not work

Saravanan
 
Old 03-10-2003, 06:34 AM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
try this:

mysql <myquery.sql >results.log
 
Old 03-10-2003, 11:12 AM   #3
BenCarlisle
LQ Newbie
 
Registered: Feb 2003
Distribution: RH7,RH8,Slack
Posts: 29

Rep: Reputation: 15
Also, try using the -B switch for actual usable results. This will write out the data as a tab-delimited data file instead of drawing the columns and tables.

cheers
 
Old 03-10-2003, 10:14 PM   #4
saravanan1979
Member
 
Registered: Jan 2002
Posts: 163

Original Poster
Rep: Reputation: 30
All the above are fine but my requirement is to export the result f a mysql query into an external files say a text file or a Excel Sheet or a HTML file..I am able to import the query from an external file and execute them..using source <filename> but tee is not working for me..
 
Old 11-12-2003, 03:19 PM   #5
buttersoft
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 178

Rep: Reputation: 30
mySQL redirecting query result to a .txt file!

Search for this in the software forum and your answer is found!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL results to html forms using PHP xemous Programming 3 08-15-2005 03:27 PM
installing mysql and php4 results in a conflict bshearer *BSD 3 04-29-2005 02:36 PM
PHP: changing row color showing mysql results emilioestevezz Programming 15 09-13-2004 06:27 PM
Exporting MySQL error when trying to Import to another database. strez4prez Linux - Software 0 05-28-2004 11:43 AM
defining an external smtp server for mailing results of chkroot cron job xfurious_mindx Linux - General 0 03-15-2004 09:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration