Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

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

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

2  
click on export tab –  Ibu Jun 27 '11 at 15:53

2 Answers 2

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

share|improve this answer

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.