I'm trying to export my MySQL database to a CSV. The command I'm using is:
The folder and write file (do I need to specify one?) permissions are both 755. The response I get is
I've got so little experience with MySQL, so I'm lost. Any tips? Thanks. asked 11 Feb '12, 15:17 atonparker |
This won't work since it requires special privileges which can't be granted to normal users. answered 11 Feb '12, 16:12 timg ♦♦ |
This may be the same reason for the "access denied" error for this: SELECT id, first_name It is possible to do this successfully using PHP: $ vi getNames.php # Type the follwing into the file. <?php $dbConn = new mysqli("127.0.0.1", "my_name", "my\_password", "my\_database"); $names = $dbConn->query("SELECT id, first_name FROM names;"); // Open a file for the delimited records. $outer = fopen("names.tab", "w"); // For each row. while ( $row = $names->fetch_row() ) { // Compose a line with tabs between fields. $lineOut = implode("\t", $row) . "\n"; // Write the line to the file. fwrite($outer, $lineOut); } fclose($outer); exit(); ?> $ php -f getNames.php answered 01 Jul '12, 00:15 flathat |
I ran into a problem using PHPMyAdmin for a large CSV export where my mysql connection kept getting cut because the download didn't finish in time. I solved it by accessing PHPMyAdmin using lynx (text based browser) from my shell on the same webfaction server. answered 18 Mar '13, 13:24 lacto |
why not simply use a tool like mysqldumper? answered 19 Mar '13, 10:46 Clooner |