[PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file...
project i'm working with, his host died or something. but, the phpMyadmin (on that host) can NOT do a backup of 200mb table without running out of memory or something weird. so what is the best way to text dump the table? i thought i would (pseudo-code): open DB do while not EOF grab 1000 rows from DB write to a file on host www path filename = filename000 + 1 until EOF user would then FTP down the files to his machine. but i figured i could use the HEADER to send it to the user. i grabbed this from the HEADER help section: ?php $output_file = 'something.txt'; $content_len = 666; @ob_end_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/octetstream; name=' . $output_file . ''); header('Content-Disposition: inline; filename=' . $output_file . ''); header(Content-length: $content_len); ? is that the best way to send the txt file to the user? thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file...
Hi the Third, have you considered dumping the table into a text file? SELECT * FROM mytable INTO OUTFILE c:/... this (AFAI) does not cause memory issues Ignatius _ - Original Message - From: Leo G. Divinagracia III [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 10, 2004 11:39 AM Subject: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file... project i'm working with, his host died or something. but, the phpMyadmin (on that host) can NOT do a backup of 200mb table without running out of memory or something weird. so what is the best way to text dump the table? i thought i would (pseudo-code): open DB do while not EOF grab 1000 rows from DB write to a file on host www path filename = filename000 + 1 until EOF user would then FTP down the files to his machine. but i figured i could use the HEADER to send it to the user. i grabbed this from the HEADER help section: ?php $output_file = 'something.txt'; $content_len = 666; @ob_end_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/octetstream; name=' . $output_file . ''); header('Content-Disposition: inline; filename=' . $output_file . ''); header(Content-length: $content_len); ? is that the best way to send the txt file to the user? thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file...
would be nice... but since this is a hosted site and no shell access or anything, i thought i would write the php script to dump the file to my web path... Ignatius Reilly wrote: Hi the Third, have you considered dumping the table into a text file? SELECT * FROM mytable INTO OUTFILE c:/... this (AFAI) does not cause memory issues Ignatius _ - Original Message - From: Leo G. Divinagracia III [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 10, 2004 11:39 AM Subject: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file... project i'm working with, his host died or something. but, the phpMyadmin (on that host) can NOT do a backup of 200mb table without running out of memory or something weird. so what is the best way to text dump the table? i thought i would (pseudo-code): open DB do while not EOF grab 1000 rows from DB write to a file on host www path filename = filename000 + 1 until EOF user would then FTP down the files to his machine. but i figured i could use the HEADER to send it to the user. i grabbed this from the HEADER help section: ?php $output_file = 'something.txt'; $content_len = 666; @ob_end_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/octetstream; name=' . $output_file . ''); header('Content-Disposition: inline; filename=' . $output_file . ''); header(Content-length: $content_len); ? is that the best way to send the txt file to the user? thanks... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Leo G. Divinagracia III [EMAIL PROTECTED] z -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] HELP: best way to TEXT dump a MySQL table to a local file...
I agree to use mysqldump to export the data to a text file. If you want to save time, you could write a php script to ftp the text file from the dead host to the new host. Then load the data back into the new database. I guess if you have broadband connection, then you might not be saving too much time. Ryan Leo G. Divinagracia III wrote: project i'm working with, his host died or something. but, the phpMyadmin (on that host) can NOT do a backup of 200mb table without running out of memory or something weird. so what is the best way to text dump the table? i thought i would (pseudo-code): open DB do while not EOF grab 1000 rows from DB write to a file on host www path filename = filename000 + 1 until EOF user would then FTP down the files to his machine. but i figured i could use the HEADER to send it to the user. i grabbed this from the HEADER help section: ?php $output_file = 'something.txt'; $content_len = 666; @ob_end_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Content-Transfer-Encoding: none'); header('Content-Type: application/octetstream; name=' . $output_file . ''); header('Content-Disposition: inline; filename=' . $output_file . ''); header(Content-length: $content_len); ? is that the best way to send the txt file to the user? thanks... Try using mysqldump from the command line. If you need a PHP script to do this, use system() or `` or one of the other system call functions. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php