Zen Cart Logo
Forums / All Other Contributions/Addons / MYSQL Backup addon error

MYSQL Backup addon error

Locked

Views: 12,030

Results 21 to 40 of 57
This thread is locked. New replies are disabled.
18 Dec 2007, 12:32 AM
#21
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

MYSQL Backup addon error

stuffdone:

Well after nosing around I learned that, despite the Zen instruction to turn on safe mode, this backup utility will not function if it is on. All the buttons etc. appear but it won't work. I either have to leave safe mode off or remember to turn it off when I want to do a backup.

I'm not sure what "Zen instruction to turn on safe mode" you're referring to.
Zen Cart has always recommended against the use of safe mode, as there are many far more efficient and effective ways to secure a server other than the overly restrictive safe mode in PHP.

So, yes, turn off safe mode. The warning message in the backup_mysql tool specifically says that it typically won't work if safe mode is turned on.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 Mar 2009, 10:54 AM
#22
auick avatar

auick

New Zenner

Join Date:
Jan 2009
Posts:
8
Plugin Contributions:
0

Re: MYSQL Backup addon error

This addon has been work great on our site almost one years, but recently after i add 10,000 more products, and database size increases from 10MB to 135MB(.sql format), backup become not work well, the download result is 0 Byte.

I am wondering if this model has any restrict like size of database or something else? Hopefully somebody can give some tips how can i get backup success again. Because it bring so much convenience to backup.

Appreciate very much for your time!

16 Mar 2009, 4:41 PM
#23
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

I have no idea why yours is having problems. I regularly use it to backup a 2GB database with no problems (takes about 2 minutes, during which the server appears frozen, but otherwise works fine).

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Sep 2009, 9:55 AM
#24
lee_mason_design avatar

lee_mason_design

New Zenner

Join Date:
Sep 2009
Posts:
2
Plugin Contributions:
0

Re: MYSQL Backup addon error

Warning: dir(DIR_FS_admin/) [function.dir]: failed to open dir: No such file or directory in /home5/fivadayd/public_html/admin/backup_mysql.php on line 402

Fatal error: Call to a member function read() on a non-object in /home5/fivadayd/public_html/admin/backup_mysql.php on line 404


I have setup 2 sites this week, both on same server, both in exactly the same way. I have looked at your previous fixes and compared the admin/includes/config.php files of bothe websites and both are set up exatly the same. I do not understand why one is working fine and one is not working at all?

The current solution on this topic is a little bit vague, as I would only have to put a / in front of my path if I swap the DIR_FS_admin for a complete file path wouldn't I?
But why would I even have to do this if it works on my other website automatically without changing anything??

Regards,

Lee

14 Sep 2009, 11:10 PM
#25
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

Lee Mason Design:

Warning: dir(DIR_FS_admin/): failed to open dir: No such file or directory ...

I don't understand why it's saying "DIR_FS_admin" instead of the uppercase "DIR_FS_ADMIN".

Furthermore, the code in the backup_mysql.php file refers to DIR_FS_BACKUP, and not DIR_FS_ADMIN at all! So, it seems whatever you've done to define('DIR_FS_BACKUP',....) is clearly pointing to the wrong thing.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Sep 2009, 9:07 AM
#26
lee_mason_design avatar

lee_mason_design

New Zenner

Join Date:
Sep 2009
Posts:
2
Plugin Contributions:
0

Re: MYSQL Backup addon error

My apologies Dr Byte!!

I masked my real admin address by typing in 'admin' for the example of my error message, oh whoops it's lowercase ..etc..

Basically, assuming for a minute that I haven't actually done anything to the original code (I hadn't)

and the code looked exactly the same as the last user who asked the very same question (it did) ..

Then what I am pointing out is (just like that other user) I had to delete your FS_ADMIN in the FS_BACKUP definition in favour of a full filepath to my backup directory in order to get it to work on the site.

Yet on the other site (on the same hosting server, and both using same version of Zen Cart, installed on the same day) it worked fine with no tweaking neccessary!

I wanted to draw attention to the fact that even on the same host this contibution looks a bit hit and miss (thus far!).

I thought that perhaps a demonstrated 'filepath fix' be offered in the installation instructions with 'MySql Backup' ?

Other users may have the same problem and this would probably save them some time.

1 Dec 2009, 10:16 PM
#27
pixelwrangler avatar

pixelwrangler

New Zenner

Join Date:
Mar 2009
Posts:
59
Plugin Contributions:
0

Re: MYSQL Backup addon error

ZC current version. Backup button appears, directory permissions 777.

Backup attempt generates:

Warning: dir(DIR_FS_backups/) [function.dir]: failed to open dir: No such file or directory in /home/fasteners/www/www/catalog/myadmin/backup_mysql.php on line 402

The relevant parts of the configure.php file:

define('DIR_FS_ADMIN', '/home/myclient/www/www/catalog/myadmin/');

define('DIR_FS_BACKUP', DIR_FS_ . 'backups/');

Any ideas as to why the backup is failing?

1 Dec 2009, 10:22 PM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

Um ... use DIR_FS_ADMIN instead of just DIR_FS_

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Jan 2010, 8:36 PM
#29
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Re: MYSQL Backup addon error

We've used this tool on multiple Zen Carts in the past and now one of them has started throwing an error when running the tool:

Result code: 2
0 => mysqldump: Got error: 1045: Access denied for user 'username'@'localhost' (using password: YES) when trying to connect
Failure: The database has NOT been saved.

Where username is our user name for the database. It seems rather odd that we're logged into the admin and then the mod is unable to use the same user info to run the backup. We're using ver 1.3.5 on this store.

Thanks for your help.

Patti - OnlineCatholicStore.com
ZC 1.3.9h with multisite mod -- ZC ROCKS!

27 Jan 2010, 8:42 PM
#30
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

If your database is actually hosted on a separate server (ie: DB_SERVER isn't 'localhost') then you're going to encounter that error, and will have to use phpMyAdmin to do the database backups instead.

If the problem "just started" but was working "before", you'll need to work with your hosting company to figure out what the "something" was that changed "before" it broke.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 Jan 2010, 10:15 PM
#31
pfabrick avatar

pfabrick

New Zenner

Join Date:
Jan 2006
Posts:
66
Plugin Contributions:
0

Re: MYSQL Backup addon error

Thank you for your update. We actually have a dedicated server which is hosting this Zen Cart and the data base resides on this server as well. We have other Zen Carts on this server which are using this mod successfully, we just can't get this one to work.

As we can back up via phpMyAdmin, it's just nicer to use this mod in the admin.

Patti - OnlineCatholicStore.com
ZC 1.3.9h with multisite mod -- ZC ROCKS!

30 Jan 2010, 2:40 PM
#32
linnx avatar

linnx

Zen Follower

Join Date:
Jun 2009
Posts:
187
Plugin Contributions:
0

Re: MYSQL Backup addon error

My Backup button disappeared. This was a great util. Any idea why the button would disappear? The restore button is still there.

Thanks

30 Jan 2010, 11:08 PM
#33
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

If the backup folder isn't writable, the button won't be shown.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Jan 2010, 12:54 PM
#34
linnx avatar

linnx

Zen Follower

Join Date:
Jun 2009
Posts:
187
Plugin Contributions:
0

Re: MYSQL Backup addon error

It is writable. chmod 777 on it. And I double checked.

Thanks

31 Jan 2010, 2:34 PM
#35
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

Okay, then either your server has PHP Safe Mode enabled, or the PHP exec() command has been disabled by the server administrator, or the backup directory specified in your admin configure.php file doesn't match the directory you think it's supposed to be using and therefore it sees that the specified directory doesn't exist.
Or the backup button image is corrupt and not displaying, and needs to be re-uploaded.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Feb 2010, 8:13 PM
#36
elijah avatar

elijah

New Zenner

Join Date:
Jul 2006
Posts:
33
Plugin Contributions:
0

Re: MYSQL Backup addon error

ZC 1.3.7

I am getting an error as well when attempting to do a backup. I get "result code: 127" on the first line and "ERROR: Could not locate the MYSQLDUMP backup utility. BACKUP FAILED." on the second line.

I read "Note that LOCAL_EXE_MYSQL and LOCAL_EXE_MYSQL_DUMP are defined in the /admin/includes/languages/backup_mysql.php file." I don't, however, have a "backup_mysql.php" file in the languages folder. Should this have been created during the install of the mod or is this something that I need to create?

Thanks for your help.

11 Feb 2010, 2:28 PM
#37
linnx avatar

linnx

Zen Follower

Join Date:
Jun 2009
Posts:
187
Plugin Contributions:
0

Re: MYSQL Backup addon error

Well I forwarded all the details to the host and he says it should work... he has no clue why it doesn't. I re-uploaded all the files.

11 Feb 2010, 5:50 PM
#38
fourbit avatar

fourbit

Zen Follower

Join Date:
Sep 2004
Location:
MONTANA!!!
Posts:
97
Plugin Contributions:
0

Re: MYSQL Backup addon error

Howdy Doc,

I have been checking this site and couldn't find any problem with the backup directory or any of the settings on the server (checked with host).

I started looking at the code in the file backup_mysql.php .

Seems that this section is causing the issue.

// now let's display the backup/restore buttons below filelist

?>

              <tr>

                <td class="smallText" colspan="3"><?php echo TEXT_BACKUP_DIRECTORY . ' ' . DIR_FS_BACKUP; ?></td>

                <td align="right" class="smallText">

                    <?php if ( ($action != 'backup') && (isset($dir)) && !get_cfg_var('safe_mode') && $dir_ok == true ) {

                             echo '<a href="' . zen_href_link(FILENAME_BACKUP_MYSQL, 'action=backup'.(($debug=='ON')?'&debug=ON':'')) . (($tables_to_export!='')?'&tables='.str_replace(' ',',',$tables_to_export):'') . '">' .

                                   zen_image_button('button_backup.gif', IMAGE_BACKUP) . '</a>  ';

                          }

                          if ( ($action != 'restorelocal') && isset($dir) ) {

                             echo '<a href="' . zen_href_link(FILENAME_BACKUP_MYSQL, 'action=restorelocal'.(($debug=='ON')?'&debug=ON':'')) . '">' .

                                   zen_image_button('button_restore.gif', IMAGE_RESTORE) . '</a>';

                          } ?>

                </td>

              </tr>

With this code in particular " !get_cfg_var('safe_mode')" .

I changed it to " !ini_get('safe_mode')" . and all works fine.

Now, I'm not familiar with these two commands much. So, I'm still researching. But, all works fine, now.

Paul

Beeee the space between the drops!
[email protected]
Hosting Duo - We're in this together!

11 Feb 2010, 6:34 PM
#39
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: MYSQL Backup addon error

That suggests that you have safe-mode set to on in the server's default php.ini setting, but you're overriding it to turn it off via a localized domain-specific php.ini or .htaccess directive.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Feb 2010, 8:33 PM
#40
fourbit avatar

fourbit

Zen Follower

Join Date:
Sep 2004
Location:
MONTANA!!!
Posts:
97
Plugin Contributions:
0

Re: MYSQL Backup addon error

Yep. Thanks Doc.

Safe_ mode is off Locally but, it is still on at the Master level. I always just look at the local values. Figuring that it's all well and good.

Don't have any idea why that host would want build the server with safe_mode on.

Anyhow, thanks again.

Paul

Beeee the space between the drops!
[email protected]
Hosting Duo - We're in this together!