Jump to content

Recommended Posts

Posted

Username: jomendes, Server: Johnny, Main domain: jomendes.heliohost.org

 

Good morning.

 

Is it possible in a Mysql Database

Use:

 

SELECT *

INTO OUTFILE 'Chart1.csv'

FROM Chart1;

 

To output it on a folder like : /home/jomendes/public_html/CSV

 

Thanks a lot

 

Best regards

 

Jos=E9 Oliveira Mendes

User jomendes

Mysql : jomendes_zcodiv

Posted

Yeah, I've never tried it myself, but that would probably work. It might be easier to write a php/python script to query the database and write the .csv file though.

Posted

PHP script is almost as easy and the same goal can be accomplished in a few lines (<10) of code. I'd personally go that route first simply because that method is going to be nearly universally supported.

 

The MySQL method you're proposing should work here, but it won't work on many other web hosts (pretty much all hosts that have the DB servers on a different server from your homedir).

Posted

Hello.

 

I tried :

SELECT * INTO OUTFILE '/home/jomendes/tmp/Chart1.csv' FROM Chart1;

 

And

 

SELECT * INTO OUTFILE 'Chart1.csv' FROM Chart1;

 

But got this message:

 

"Error Code : 1045

Access denied for user 'jomendes_jom'@'148.63.118.236' (using password: YES)

(156 ms taken)"

 

Can you please confirm the right syntax to use for the Outfile

(A directory where it works)

 

Thanks a lot

 

-----Original Message-----

Guest
This topic is now closed to further replies.
×
×
  • Create New...