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

MYSQL Backup addon error

Locked

Views: 12,030

Results 1 to 20 of 57
This thread is locked. New replies are disabled.
23 Jan 2007, 11:50 AM
#1
cadfc avatar

cadfc

New Zenner

Join Date:
Jan 2006
Location:
London, United Kingdom
Posts:
19
Plugin Contributions:
0

MYSQL Backup addon error

zencart version: 1.3.6 (will be upgraded shortly!)
PHP: 4.4.4
MYSQL: 4.1.21

My store's not able to backup MYSQL database due to mysqldump path error.

Error Messages

"Result code: 127"

"Skip Lock option (check this if you get a LOCK TABLES permissions error)
ERROR: Could not locate the MYSQLDUMP backup utility. BACKUP FAILED."

one line from my /admin/includes/languages/english/backup_mysql.php > define('LOCAL_EXE_MYSQLDUMP', '/usr/bin/mysqldump'); // used for backups

My host insisted the location of mysqldump is locating at /usr/bin/ so backup_mysql.php is correct.

My hosting tech further investigated and stated:

We have investigated your issue and the error we receive in the logs while running the backups is:

sh: /usr/bin/mysqldump --host=localhost --user=xxxxxx --password=xxxxxx --opt --complete-insert --skip-lock-tables --result-file=/home/xxxxx/public_html/admin/backups/db_xxxxx_zencart_xxx.sql xxxxxx_zencart 2>&1: No such file or directory
sh: -c: line 0: syntax error near unexpected token 0' sh: -c: line 0: exit(0)'.

which mean that the backup utility is looking for the backup file instead of creating one. I would suggest you to acquire support from the developers of Zen cart as any changes made by us would brake some thing.

I've read http://www.zen-cart.com/forum/showthread.php?t=45039 and http://www.zen-cart.com/forum/showthread.php?t=45238. But I'm not sure what next actions I shall take? Any suggestions?

23 Jan 2007, 6:11 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

That same syntax works fine on a large number of other hosts without problem.

I'm not sure how it should be changed to work with your particular host's server configuration. Without knowing detailed configuration differences between their servers and other servers, there is no quick answer.

If you wanted to remove the "2>&1" part from the command sent to the server, you might find the error message will change to reflect more accurately what is happening, as I suspect using that on the command line is confusing the shell, since it's primarily used to send feedback to a calling script, which a shell statement doesn't have access to.

To get a database backup "today", I suggest you use phpMyAdmin instead:
http://www.zen-cart.com/wiki/index.php/LocalCopySite#TO_BACKUP_THE_DATABASE

.
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.

23 Jan 2007, 8:00 PM
#3
tcustomgolf avatar

tcustomgolf

Inactive

Join Date:
Dec 2005
Location:
NY
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

Hey Doc, I see you authored the Backup MYSQL Plugin and looking for some help on an error.

Getting errors on both my live 1.2.7 and test 1.3.7 carts within the admins. Enclosed screenshot..."backups" dir is there and chmoded at 777..

Custom Golf Clubs - A ZenCart Site!
Get fitted online for a better game!

23 Jan 2007, 8:28 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

"Error: Backup directory does not exist. Please set this in configure.php"
"Warning: dir(home/tcustom/public_html/zen137/admin/backups/) faied to open dir -- no such file or directory."

Try putting a / at the beginning of the backup path in your admin configure.php. You can't use just "home/tcustom...." ... you need "/home/tcustom...."

.
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.

23 Jan 2007, 9:00 PM
#5
tcustomgolf avatar

tcustomgolf

Inactive

Join Date:
Dec 2005
Location:
NY
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

In my admin configure.php I changed this:

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

to this:

define('DIR_FS_BACKUP', DIR_FS_ADMIN . '/home/tcustom/public_html/zen137/admin/backups/');

but error still saying the backups dir does not exist and it doubles itself as below...

Warning: dir(home/tcustom/public_html/zen137/admin//home/tcustom/public_html/zen137/admin/backups/) [function.dir]: failed to open dir: No such file or directory in /home/tcustom/public_html/zen137/admin/backup_mysql.php on line 385

Custom Golf Clubs - A ZenCart Site!
Get fitted online for a better game!

23 Jan 2007, 9:34 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

undo that change, or remove the DIR_FS_ADMIN . portion.

what are the permissions and ownership on the "backups" folder ?

oh ... what is your DIR_FS_ADMIN setting ?

.
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.

24 Jan 2007, 1:59 AM
#7
tcustomgolf avatar

tcustomgolf

Inactive

Join Date:
Dec 2005
Location:
NY
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

Good work, Doc!

My DIR_FS_ADMIN define did not have the leading / in the configure.php
Added that and I'm good!

Appreciate the help!

Custom Golf Clubs - A ZenCart Site!
Get fitted online for a better game!

29 Jan 2007, 10:32 AM
#8
cadfc avatar

cadfc

New Zenner

Join Date:
Jan 2006
Location:
London, United Kingdom
Posts:
19
Plugin Contributions:
0

Re: MYSQL Backup addon error

DrByte,

Thank, I'll use PhpMyAdmin to backup for now.

Cheers

31 Jan 2007, 4:57 PM
#9
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

ive just installed the backup files, when i go into admin tools and the backup page, there is just a button saying restore, should i have a backup button?

so it can be backed up before needing to restore it?

sorry if its a silly question

Andy

31 Jan 2007, 4:59 PM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: MYSQL Backup addon error

Have you checked that your admin/backups directory is writeable?

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

31 Jan 2007, 5:03 PM
#11
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

backup folder is CHMOD 777

Andy

31 Jan 2007, 5:08 PM
#12
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

The Backup button will not appear if PHP is unable to locate or write to the backup folder defined by DIR_FS_BACKUP.

.
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 2007, 5:27 PM
#13
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

where do i define the DIR_FS_BACKUP?

My comfig file says this

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

Andy

31 Jan 2007, 5:43 PM
#14
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

andy:

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

and that normally translates to ..../public_html/...../admin/backups/

.
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 2007, 7:00 PM
#15
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

the backup page in admin
shows the link as
Backup Directory: /home/httpd/vhosts/realraptors.co.uk/httpdocs/zen-cart-v1.1.3/admin/backups/

which is correct

Andy

31 Jan 2007, 7:40 PM
#16
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

Is it possible your server is running PHP in Safe Mode ? If so, the backup button will not be displayed then either.

.
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 2007, 7:47 PM
#17
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

how do i find this out? is it a call to my hosting company tomorrow?

Andy

31 Jan 2007, 8:33 PM
#18
drbyte avatar

drbyte

Sensei

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

Re: MYSQL Backup addon error

Admin->Tools->Server Info.
Search for "safe_mode"

Yes - call your hosting company and ask to be put on a server that doesn't run in safe mode.

.
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 2007, 8:41 PM
#19
andy avatar

andy

Zen Follower

Join Date:
Feb 2004
Posts:
162
Plugin Contributions:
0

Re: MYSQL Backup addon error

thanks

safe mode is on

will call them tomorrow. thanks

Andy

17 Dec 2007, 11:46 PM
#20
stuffdone avatar

stuffdone

Zen Follower

Join Date:
Jul 2007
Posts:
156
Plugin Contributions:
0

Re: MYSQL Backup addon error

"Result code: 127"

"Skip Lock option (check this if you get a LOCK TABLES permissions error)
ERROR: Could not locate the MYSQLDUMP backup utility. BACKUP FAILED."

==
I have same error. I did a backup last week and everything worked fine. Now all of a sudden I get this error. /admin/backups is CHMOD 777

Why would it stop working when it was working previously?

:mellow:

==/edit

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.

28 years web design and counting.
https://stuffdone.com