Re: [PHP] It's Friday (a MySQL Question) [Solution]

2010-08-17 Thread tedd
At 5:48 PM -0400 8/13/10, tedd wrote: Normally if I want to dump a MySQL database, I read the database via a PHP script (i.e., list tables and fetch rows) and save the results as a text file -- after which I download the file -- it's not a big deal. However while I was doing my daily read of

Re: [PHP] It's Friday (a MySQL Question)

2010-08-14 Thread tedd
At 6:53 PM -0400 8/13/10, chris h wrote: Tedd I don't know if this will resolve your issue or not, but have you looked into using mysqldump? http://dev.mysql.com/doc/refman/5.1/en/mysqldump.htmlhttp://dev.mysql.com/doc/refman/5.1/en/mysqldump.html That's what I use for my backups. Chris.

Re: [PHP] It's Friday (a MySQL Question)

2010-08-14 Thread chris h
Well you certainly can not use this without the command line, however some hosts restrict you from the command line but still allow you to run commands via php's exec() function (Rackspace Sites is an example of this). pseudo code example: exec('mysqldump [options] --all-databases ... '); Of

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Ashley Sheridan
On Fri, 2010-08-13 at 17:48 -0400, tedd wrote: Hi gang: Normally if I want to dump a MySQL database, I read the database via a PHP script (i.e., list tables and fetch rows) and save the results as a text file -- after which I download the file -- it's not a big deal. However while I

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Daniel P. Brown
On Fri, Aug 13, 2010 at 17:48, tedd t...@sperling.com wrote:    SELECT * FROM table_reference INTO OUTFILE 'file_name' It looked to be bit simpler/shorter than my code, so I tried it. But it reports:    Access denied for user 'me'@'localhost' (using password: YES). I suspect that the

RE: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Daevid Vincent
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Friday, August 13, 2010 3:00 PM To: tedd Cc: php-general@lists.php.net Subject: Re: [PHP] It's Friday (a MySQL Question) On Fri, 2010-08-13 at 17:48 -0400, tedd wrote: Hi gang: Normally

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Daniel P. Brown
On Fri, Aug 13, 2010 at 17:59, Ashley Sheridan a...@ashleysheridan.co.uk wrote: echo 'password' | mysql -u root -p query If you're going to do the password in plain text from the command line like that (which is a bad idea), you don't need to pipe an echo. Just type: mysql -u

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Ashley Sheridan
On Fri, 2010-08-13 at 18:14 -0400, Daniel P. Brown wrote: On Fri, Aug 13, 2010 at 17:59, Ashley Sheridan a...@ashleysheridan.co.uk wrote: echo 'password' | mysql -u root -p query If you're going to do the password in plain text from the command line like that (which is a bad

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Daniel P. Brown
On Fri, Aug 13, 2010 at 18:17, Ashley Sheridan a...@ashleysheridan.co.uk wrote: To both David and Daniel, thank you! How on earth I ever missed that argument before is a wonder known only to the great electronic deity in the sky! Hey, Daevid: you may have been thanked first, but at least

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Ashley Sheridan
On Fri, 2010-08-13 at 18:22 -0400, Daniel P. Brown wrote: On Fri, Aug 13, 2010 at 18:17, Ashley Sheridan a...@ashleysheridan.co.uk wrote: To both David and Daniel, thank you! How on earth I ever missed that argument before is a wonder known only to the great electronic deity in the

RE: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Daevid Vincent
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Friday, August 13, 2010 3:23 PM To: Daniel P. Brown Cc: tedd; php-general@lists.php.net Subject: Re: [PHP] It's Friday (a MySQL Question) On Fri, 2010-08-13 at 18:22 -0400, Daniel P. Brown wrote

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread tedd
At 6:11 PM -0400 8/13/10, Daniel P. Brown wrote: On Fri, Aug 13, 2010 at 17:48, tedd t...@sperling.com wrote: SELECT * FROM table_reference INTO OUTFILE 'file_name' It looked to be bit simpler/shorter than my code, so I tried it. But it reports: Access denied for user

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread chris h
Tedd I don't know if this will resolve your issue or not, but have you looked into using mysqldump? http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html That's what I use for my backups. Chris. On Fri, Aug 13, 2010 at 6:47 PM, tedd t...@sperling.com wrote: At 6:11 PM -0400 8/13/10, Daniel

Re: [PHP] It's Friday (a MySQL Question)

2010-08-13 Thread Simon J Welsh
On 14/08/2010, at 9:59 AM, Ashley Sheridan wrote: I've only ever done something like this via the command line. Having said that, could you maybe pass a command line string to exec(). Something like (untested): echo 'password' | mysql -u root -p query I believe that is the right sort of