#1
  1. No Profile Picture
    BobB
    Guest
    Devshed Newbie (0 - 499 posts)
    I have figured out how to import a tab delimited text file from the webserver directory into the MySQL database with the following:

    LOAD DATA LOCAL INFILE '/home/www/textfile.txt' INTO TABLE tablename

    But am so far unable to export from a MySQL table into a text file on the web server. Last tried the following:

    SELECT * FROM tablename INTO LOCAL OUTFILE '/home/www/exporttext.txt'

    Any suggestions?

    Thanks.
  2. #2
  3. No Profile Picture
    DesertFox
    Guest
    Devshed Newbie (0 - 499 posts)
    Bob,

    This command worked for me:

    select * into outfile '/home/www/myfile.txt' from <mytable>;

    This will save it on the server, so maybe you can ftp it out to your local computer?

    I've had troubles using the LOCAL keyword.


    Regards

Similar Threads

  1. export mysql to text file via PHP
    By tommy916 in forum PHP Development
    Replies: 2
    Last Post: September 15th, 2003, 11:13 AM
  2. Replies: 1
    Last Post: December 8th, 2002, 04:23 AM
  3. Comparing a text file to a DB
    By scrtagt69 in forum PHP Development
    Replies: 1
    Last Post: July 15th, 2002, 08:15 PM
  4. Query to insert data from text file
    By scrtagt69 in forum MySQL Help
    Replies: 0
    Last Post: July 12th, 2002, 12:27 PM
  5. sql problem
    By rajensama in forum MySQL Help
    Replies: 6
    Last Post: December 23rd, 2001, 02:27 PM

IMN logo majestic logo threadwatch logo seochat tools logo