Forum Moderators: coopster

Message Too Old, No Replies

Exporting MYSQL for excel?

Carn't get things in the right places

         

lasko

10:50 am on Sep 3, 2003 (gmt 0)

10+ Year Member



I now have a nice on-line mysql database stored on a shared hosting server.

I often import data into the database using the admin area with text files etc.

I now need to export all my data from mysql into excel, which could then be put into any other database offline.

I have tried running

SELECT a,b INTO OUTFILE "/tmp/result.text"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
FROM test_table;

But can't locate the final output file on the server so I tried to make it output on my computer using C:/my_documents/ etc but still nothing, the admin says success but no file any where.

Their is an option in my admin thats says display all data for excel terminate feild using , or ; but when I copy and paste the results into a text file then try to import into excel even after correcting the dilimators it ends up in wrong columns etc.

How can I download all my mysql data in a nice format with the field headers and import into excel with the feild headers?

Any help would be really appreciated.

Cheers

vincevincevince

10:55 am on Sep 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try using a full server path in your previous command i.e. server/user/site/www/html/output.file - phpinfo will tell you your path if you don't know it

lasko

11:33 am on Sep 3, 2003 (gmt 0)

10+ Year Member



ok problem solved.

In my ever hard way of learning the data is bad.

I have too many blank return spaces and also i beleive these <br> are not good so i replace with <#>

This is one lesson i have learn't the hard way clean data is a must.

I now have to look at the best ways of cleaning everything before I put it into the database.