MySQL DUMP as CSV

Posted by swt83 on Stack Overflow See other posts from Stack Overflow or by swt83
Published on 2010-03-30T18:15:22Z Indexed on 2010/03/30 18:23 UTC
Read the original article Hit count: 338

Filed under:
|

I've looked around and nothing seems to work:

$file = '/path/to/file.csv';
$cmd = 'mysqldump DATABASE TABLE > '.$file.' --host=localhost --user=USER --password=PASS';
$cmd .= ' --lock-tables=false --no-create-info --tab=/tmp --fields-terminated-by=\',\'';
exec($cmd);

Everything I try creates an empty CSV file. Any ideas? Thanks much.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql