Welcome to WebmasterWorld Guest from 54.158.143.40

Forum Moderators: open

Message Too Old, No Replies

phpmyadmin Select INTO OUTFILE

how to

   
7:07 pm on Mar 11, 2010 (gmt 0)

5+ Year Member



how do i extract values of a field in SQL using phpmyadmin when the host is not my localhost ?

The following commands work well on localhost:
SELECT NAME
INTO OUTFILE '/name.txt'
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
FROM tablename
;


I've read it should run like this on another host, but it doesnt work:

mysql hostIP username password -e
SELECT name
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
FROM tablename databasename
> emails.txt

Do you know how you run this command in phpmyadmin ?
10:16 pm on Mar 23, 2010 (gmt 0)

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member



In phpmyadmin, you'd need to connect to a different host first. Just edit your phpMyAdmin configuration file with additional entries in the $cfg['Servers'] array and you'll be able to switch from one host to another.
10:31 pm on Mar 23, 2010 (gmt 0)

WebmasterWorld Administrator brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Also fyi, the 'outfile' can only be created on the same server as SQL, i.e. you can't run the query to a remote server and have the file saved locally.