Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Backup MySQL mod - Windows 2003 problem

    Hi,

    I just installed the Backup MySQL mod, created the "/admin/backups" folder

    but am getting this error when I attempt a backup:

    Result code: 1
    0 => 'C:/Program' is not recognized as an internal or external command,
    1 => operable program or batch file.
    Failure: The database has NOT been saved.

    I have ZenCart 1.3.7

    I also added permission for cmd.exe to have execute privs for Inet User.
    and set the path in backup_mysql.php to:

    define('LOCAL_EXE_MYSQL', 'C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql.exe'); // used for restores
    define('LOCAL_EXE_MYSQLDUMP', 'C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqldump.exe'); // used for backups

    What is the error telling me ?

    thanks for help in advance...

  2. #2
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Backup MySQL mod - Windows 2003 problem

    is it complaining about a windows long filename issue ?

  3. #3
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Backup MySQL mod - Windows 2003 problem

    is it complaining about a windows long filename issue ?
    Already heard about this before in the past. I think this has something do to with it or it could also be about permission issues.

  4. #4
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Backup MySQL mod - Windows 2003 problem

    ok, looks like I am near a solution.

    i turned on the debug mode in the backup script..that told me the basic command line was ok, but windows was complaining about the long filename.

    i was able to get it working by putting double quote around the long filename, like this > "filename"

    now it works on the cmd line. just need to fix the script how it handles the name.

    here is the cmd that works ...changed to protect the innocent..

    "C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump.exe" --host=localhost --user=someguy --password=somepasswd --opt --complete-insert --result-file=C:/WWW/blahsite/zcart/admin/backups/db_zencart-20070701153752.sql zencart 2>&1

  5. #5
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Backup MySQL mod - Windows 2003 problem

    so, after messing around with this script, I got it kinda working, but now I get this in the browser after the backup completes (verified it wrote the backup file):

    "CGI Error

    The specified CGI application misbehaved by not returning a complete set of HTTP headers."


    btw, the fix to the script is about the stupid quotes for windows.
    These are the changed lines in backup_myysql.php, I removed the double quotes, and then *added* double quotes to fix the long file name problem.

    [FONT=System]$dump_params .= ' --host=' . DB_SERVER . '';[/FONT]
    [FONT=System]$dump_params .= ' --user=' . DB_SERVER_USERNAME . '';[/FONT]
    [FONT=System]$dump_params .= ' --password=' . DB_SERVER_PASSWORD . '';[/FONT]
    [FONT=System][FONT=System]$dump_params .= ' --result-file=' . DIR_FS_BACKUP . $backup_file . '';[/FONT]

    [FONT=System][FONT=System]$toolfilename = (isset($_GET['tool']) && $_GET['tool'] != '') ? $_GET['tool'] : $mysqldump_exe;[/FONT]
    [FONT=System]$toolfilename = '"' . $toolfilename . '"' ;[/FONT]
    [/FONT]
    [/FONT]

  6. #6
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Backup MySQL mod - Windows 2003 problem

    PHP Code:
    $toolfilename = (isset($_GET['tool']) && $_GET['tool'] != '') ? zen_db_prepare_input($_GET['tool']) : $mysqldump_exe

  7. #7
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Backup MySQL mod - Windows 2003 problem

    hmm... thanks for that, but for some reason it didn't help.

    I still get the cgi header error.

  8. #8
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Backup MySQL mod - Windows 2003 problem

    I think the problem might be something to do with how IIS handles redirects from PHP.

    my php.ini does have :
    cgi.force_redirect = 0

    but I don't know what else I can do...

    I saw a reply in a post from you (TheOracle) that suggested this, wondering if it is still valid :
    post link >> http://www.zen-cart.com/forum/showth...ion+misbehaved

    Sure. Look

    for :

    Quote:


    define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'


    replace with :

    Code:
    define('STORE_SESSIONS', 'file'); // leave empty '' for default handler or set to 'db'
    This should clear out the issue.

    Recall: This has to be done on both configure.php files (/admin/includes and /includes).

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Backup MySQL mod - Windows 2003 problem

    To get around Windows' need to use quotes when handling paths that include spaces in the filename/path, simply edit line 23 from this:
    Code:
      define('OS_DELIM', '');
    to this:
    Code:
      define('OS_DELIM', '"');
    .

    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.

  10. #10
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Backup MySQL mod - Windows 2003 problem

    Quote Originally Posted by DrByte View Post
    To get around Windows' need to use quotes when handling paths that include spaces in the filename/path, simply edit line 23 from this:
    Code:
      define('OS_DELIM', '');
    to this:
    Code:
      define('OS_DELIM', '"');
    thank you...

    do you anything to solve the cgi header error ?

 

 

Similar Threads

  1. MySQL Backup Tool on Windows IIS Server
    By chadderuski in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 20 Jun 2012, 03:06 AM
  2. Backup MySQL mod v1.4 - problem
    By Earnest-Enterprises in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 22 Nov 2010, 01:45 AM
  3. Use MySQL Backup Mod as transfer utility?
    By rbobzin in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 3 Jan 2008, 12:14 AM
  4. MySQL Backup Mod
    By atlantis in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 15 Oct 2006, 12:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR