I am using phpmyadmin on ubuntu to import a table, and I used this command

select * from questionresults into outfile 'training.txt'

to convert the table into text file, but I cant find where this file has been saved or maybe I don't have privilege to access it! does anybody know another way to convert it into text file or how to find the location of this file? I tried to export the table as text file but It comes with many symbols and I don't have time to pre-process the data.

link|improve this question
2  
click on export tab – Ibu Jun 27 '11 at 15:53
feedback

migrated from stackoverflow.com Jun 27 '11 at 16:43

This question came from our site for professional and enthusiast programmers.

2 Answers

You can specify an absolute path:

Linux

select * from questionresults into outfile '/usr/test/training.txt'

The directory needs to be world writable on Linux.

Windows

select * from questionresults into outfile 'c:/test/training.txt'

Note the use of forward slashes even on Windows
On Windows you need to give MySQL (or everybody) write access to the directory, otherwise MySQL will not be able to write the file.

More info:
http://www.mysqlfaqs.net/mysql-faqs/Data-Back-Up/Export-Data/How-to-use-SELECT-INTO-OUTFILE-statement-to-export-data

link|improve this answer
feedback

Depending on the setup (particularly if MySQL is running on a separate server), you may not be able to use INTO OUTFILE. You might be able to use a command-line alternative:

mysql db_name < query.sql > training.txt
link|improve this answer
feedback

Your Answer

 
or
required, but never shown