Page 1 of 1

How to output result to .csv file format?

Posted: Mon Oct 04, 2004 2:59 pm
by ljCharlie
How do I output the result to a .csv file format if I telnet to the MySQL database?

ljCharlie

Posted: Mon Oct 04, 2004 3:06 pm
by feyd

Posted: Mon Oct 04, 2004 3:15 pm
by ljCharlie
Thanks, feyd! That's exactly what I want. I did try to search the msyql.com website but don't remember exactly word or phrase to search for.

ljCharlie

Posted: Mon Oct 04, 2004 3:17 pm
by feyd
I searched for "outfile"..

Posted: Tue Oct 05, 2004 7:55 am
by ljCharlie
Again, thanks! However, it didn't work. I received an error. Here's what I did.

Code: Select all

mysql> SELECT * INTO OUTFILE 'emailDirectory.csv' FROM email;
The error from the above command is:

ERROR 1045: Access denied for user: 'alumni@localhost' (Using Password: YES)


Any idea on what I did wrong or what's going on? The user name and password I used to logon to the mysql database does have full right. The reason I know this is that the Administrator who gave me this account say so and I was able to do anything using phpMyAdmin to edit/change/delete/add.

Another question, is there a way to do the same thing within phpMyAdmin?

ljCharlie

export

Posted: Tue Oct 05, 2004 8:12 am
by phpScott
look for the export tab and in there you should find all the things neccessary including saving the file somewhere of even printing it to the screen in case you don't hava access to the file structure.

Posted: Tue Oct 05, 2004 8:37 am
by ljCharlie
Thanks! I didn't see the export tab what I did see something in phpMyAdmin to export to a .csv file format.

Again, thanks!

ljCharlie