1

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.

1
  • 2
    click on export tab
    – Ibu
    Jun 27, 2011 at 15:53

2 Answers 2

1

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

0
0

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

You must log in to answer this question.