MySQLDump through PHP/HTML UI

MySQLDump through PHP/HTML UI

am 10.12.2008 16:32:17 von phphelp -- kbk

Hello - - -- -

I have a utility which creates a MySQLDump of selected tables or the
whole database. This works fine on my development machine, a W2K
box. It does not work on the testing server, a linux box.

I'll post code if you want, but it is very simple:

1. I create the "dump" language, including the file into which the
data is dumped into a variable.

2. I perform system($dump_language). I also tried it exec
($dump_language). Both produce the same result:

The file is created (the directory is one for which the application
has r/w rights). In Windoze, the file is complete and perfect. On the
Linux box, only the header information of the dump file is written,
nothing about any database or table.

Any ideas?

Thank you,

Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: MySQLDump through PHP/HTML UI

am 10.12.2008 16:43:03 von Yves Sucaet

Hi Ken,

How long does the mysqldump operation last? Maybe it's a script timeout
problem? And maybe you have different settings on both machines?

Other idea: what about pathnames? Linux uses "/" to separate paths, Windows
uses "\".

That's all I have for now,

Yves


----- Original Message -----
From: "phphelp -- kbk"
To:
Sent: Wednesday, December 10, 2008 9:32 AM
Subject: [PHP-DB] MySQLDump through PHP/HTML UI


> Hello - - -- -
>
> I have a utility which creates a MySQLDump of selected tables or the
> whole database. This works fine on my development machine, a W2K box. It
> does not work on the testing server, a linux box.
>
> I'll post code if you want, but it is very simple:
>
> 1. I create the "dump" language, including the file into which the data
> is dumped into a variable.
>
> 2. I perform system($dump_language). I also tried it exec
> ($dump_language). Both produce the same result:
>
> The file is created (the directory is one for which the application has
> r/w rights). In Windoze, the file is complete and perfect. On the Linux
> box, only the header information of the dump file is written, nothing
> about any database or table.
>
> Any ideas?
>
> Thank you,
>
> Ken
>
> --
> 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: MySQLDump through PHP/HTML UI

am 10.12.2008 18:38:23 von Ken

Merci, Yves - --

It takes the blink of an eye. It seems like none of the string is
running at all.

Also, yeah, the slashes thing used to trip me up, too, when I first
started working around Linux boxes. However, the file *is* being
created and it is in the right place, just nothing in it.

Ken

On Dec 10, 2008, at 9:43 AM, Yves Sucaet wrote:

> Hi Ken,
>
> How long does the mysqldump operation last? Maybe it's a script
> timeout problem? And maybe you have different settings on both
> machines?
>
> Other idea: what about pathnames? Linux uses "/" to separate paths,
> Windows uses "\".
>
> That's all I have for now,
>
> Yves
>
>
> ----- Original Message ----- From: "phphelp -- kbk"
>
> To:
> Sent: Wednesday, December 10, 2008 9:32 AM
> Subject: [PHP-DB] MySQLDump through PHP/HTML UI
>
>
>> Hello - - -- -
>>
>> I have a utility which creates a MySQLDump of selected tables or
>> the whole database. This works fine on my development machine, a
>> W2K box. It does not work on the testing server, a linux box.
>>
>> I'll post code if you want, but it is very simple:
>>
>> 1. I create the "dump" language, including the file into which
>> the data is dumped into a variable.
>>
>> 2. I perform system($dump_language). I also tried it exec
>> ($dump_language). Both produce the same result:
>>
>> The file is created (the directory is one for which the
>> application has r/w rights). In Windoze, the file is complete and
>> perfect. On the Linux box, only the header information of the
>> dump file is written, nothing about any database or table.
>>
>> Any ideas?
>>
>> Thank you,
>>
>> Ken
>>
>> --
>> 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
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: MySQLDump through PHP/HTML UI

am 10.12.2008 22:21:32 von Yves Sucaet

What PHP-function/command are you using to invoke the mysqldump command?

Try including a flush() statement right before you start dumping. I don't
know why it works, but it's solved some of my problems in the past. Must be
something with buffer management.

hth,

Yves

----- Original Message -----
From: "Ken Kixmoeller.com"
To:
Sent: Wednesday, December 10, 2008 11:38 AM
Subject: Re: [PHP-DB] MySQLDump through PHP/HTML UI


> Merci, Yves - --
>
> It takes the blink of an eye. It seems like none of the string is running
> at all.
>
> Also, yeah, the slashes thing used to trip me up, too, when I first
> started working around Linux boxes. However, the file *is* being created
> and it is in the right place, just nothing in it.
>
> Ken
>
> On Dec 10, 2008, at 9:43 AM, Yves Sucaet wrote:
>
>> Hi Ken,
>>
>> How long does the mysqldump operation last? Maybe it's a script timeout
>> problem? And maybe you have different settings on both machines?
>>
>> Other idea: what about pathnames? Linux uses "/" to separate paths,
>> Windows uses "\".
>>
>> That's all I have for now,
>>
>> Yves
>>
>>
>> ----- Original Message ----- From: "phphelp -- kbk"
>>
>> To:
>> Sent: Wednesday, December 10, 2008 9:32 AM
>> Subject: [PHP-DB] MySQLDump through PHP/HTML UI
>>
>>
>>> Hello - - -- -
>>>
>>> I have a utility which creates a MySQLDump of selected tables or the
>>> whole database. This works fine on my development machine, a W2K box.
>>> It does not work on the testing server, a linux box.
>>>
>>> I'll post code if you want, but it is very simple:
>>>
>>> 1. I create the "dump" language, including the file into which the
>>> data is dumped into a variable.
>>>
>>> 2. I perform system($dump_language). I also tried it exec
>>> ($dump_language). Both produce the same result:
>>>
>>> The file is created (the directory is one for which the application
>>> has r/w rights). In Windoze, the file is complete and perfect. On the
>>> Linux box, only the header information of the dump file is written,
>>> nothing about any database or table.
>>>
>>> Any ideas?
>>>
>>> Thank you,
>>>
>>> Ken
>>>
>>> --
>>> 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
>>
>
>
> --
> 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: MySQLDump through PHP/HTML UI

am 10.12.2008 22:50:07 von dmagick

phphelp -- kbk wrote:
> Hello - - -- -
>
> I have a utility which creates a MySQLDump of selected tables or the
> whole database. This works fine on my development machine, a W2K box.
> It does not work on the testing server, a linux box.
>
> I'll post code if you want, but it is very simple:
>
> 1. I create the "dump" language, including the file into which the data
> is dumped into a variable.
>
> 2. I perform system($dump_language). I also tried it
> exec($dump_language). Both produce the same result:

What cmd are you putting together (I assume something for mysqldump)? If
you run it manually from the cmd line, does it work? Does it give an error?

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: MySQLDump through PHP/HTML UI

am 11.12.2008 04:25:37 von phphelp -- kbk

Hi, Chris -- -- -- --

Yes, thanks for the suggestion: it runs from the command line just
fine. I run them often, and it works in Windows.

However, I just was able to gain access again to the error log (long
story), and I see that the page is throwing an unrelated error that
it does not throw in Windows. I will run down that road and see if
that error is somehow getting in the way.

Thank you for your ideas.

Ken

On Dec 10, 2008, at 3:50 PM, Chris wrote:

> phphelp -- kbk wrote:
>> Hello - - -- -
>> I have a utility which creates a MySQLDump of selected tables or
>> the whole database. This works fine on my development machine, a
>> W2K box. It does not work on the testing server, a linux box.
>> I'll post code if you want, but it is very simple:
>> 1. I create the "dump" language, including the file into which the
>> data is dumped into a variable.
>> 2. I perform system($dump_language). I also tried it exec
>> ($dump_language). Both produce the same result:
>
> What cmd are you putting together (I assume something for
> mysqldump)? If you run it manually from the cmd line, does it work?
> Does it give an error?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: MySQLDump through PHP/HTML UI

am 11.12.2008 04:46:20 von Ken

On Dec 10, 2008, at 3:21 PM, Yves Sucaet wrote:


> What PHP-function/command are you using to invoke the mysqldump
> command?
>

As I said in the original post, I have used both system() and exec(),
both with the same result.




> Try including a flush() statement right before you start dumping.
>

I'll try it, thanks.

Ken


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: MySQLDump through PHP/HTML UI

am 11.12.2008 05:14:04 von dmagick

phphelp -- kbk wrote:
> Hi, Chris -- -- -- --
>
> Yes, thanks for the suggestion: it runs from the command line just fine.
> I run them often, and it works in Windows.
>
> However, I just was able to gain access again to the error log (long
> story), and I see that the page is throwing an unrelated error that it
> does not throw in Windows. I will run down that road and see if that
> error is somehow getting in the way.

You're not calling mysqldump.exe on *nix are you? :) Hence
the suggestion to print out the full cmd and try it manually to make
sure it's being put together appropriately..

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: MySQLDump through PHP/HTML UI

am 11.12.2008 19:24:05 von phphelp -- kbk

Hi, Rick - - -

Well, there really is not a lot to tell. Yes, it is being prompted by
a HTML page. I show the table names with checkboxes or an "all."

As a result, I build the simplest 'dump" statement;
mysqldump databasename>path/outfilename,sql --tables --
user=dunknob --password=doorknob

Anyway, it did turn out to be a permissions problem, so marked this
one with a big SOLVED. it didn't smell like one, however, as the file
was being written, the "dump' heading lines were there, just the
parameters were ignored.

Ah, well ----

Thanks for your suggestions.

Ken


On Dec 10, 2008, at 9:42 PM, lists-php wrote:

> you don't give a lot of information of how you are running your
> utility, but you're likely to run into file permission issues in a
> linux context that you won't have in a windoz one.
>
> if you're running it through a web page you'll be trying to write
> the dump file as the user that your web server runs under (by
> default "apache"). generally (and in a secure setup) that user will
> not have the ability to write to files under the documentroot.
>
>
> - Rick
>
> ------------ Original Message ------------
>> Date: Wednesday, December 10, 2008 09:25:37 PM -0600
>> From: phphelp -- kbk
>> To: php-db@lists.php.net
>> Subject: Re: [PHP-DB] MySQLDump through PHP/HTML UI
>>
>> Hi, Chris -- -- -- --
>>
>> Yes, thanks for the suggestion: it runs from the command line just
>> fine. I run them often, and it works in Windows.
>>
>> However, I just was able to gain access again to the error log
>> (long story), and I see that the page is throwing an unrelated
>> error that it does not throw in Windows. I will run down that road
>> and see if that error is somehow getting in the way.
>>
>> Thank you for your ideas.
>>
>> Ken
>>
>> On Dec 10, 2008, at 3:50 PM, Chris wrote:
>>
>>> phphelp -- kbk wrote:
>>>> Hello - - -- -
>>>> I have a utility which creates a MySQLDump of selected tables or
>>>> the whole database. This works fine on my development machine,
>>>> a W2K box. It does not work on the testing server, a linux box.
>>>> I'll post code if you want, but it is very simple:
>>>> 1. I create the "dump" language, including the file into which
>>>> the data is dumped into a variable.
>>>> 2. I perform system($dump_language). I also tried it exec
>>>> ($dump_language). Both produce the same result:
>>>
>>> What cmd are you putting together (I assume something for
>>> mysqldump)? If you run it manually from the cmd line, does it
>>> work? Does it give an error?
>>>
>>> --
>>> Postgresql & php tutorials
>>> http://www.designmagick.com/
>
> ------------ End Original Message ------------
>
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php