Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2007
    Posts
    30
    Plugin Contributions
    0

    Default Backup MySQL Database: Result code: 2

    I have the Backup MySQL Database mod installed and I'm getting this error message every time I attempt a backup:

    Code:
    Result code: 2
    Failure: The database has NOT been saved.
    From searching the forums I see that the error messages others describe seem to include some additional info indicating the cause of the error, but I just get the two lines above and nothing more.

    Also, as it happens, I have two separate Zen Carts running on this particular server, each on its own database, and the backup DB module works fine on my other cart. Other than content, the only difference I'm aware of is that the cart giving me the problems is a new install of 1.3.7.1 whereas the one that works is plain old 1.3.7.

    At first I thought it might be my connection settings: Around the time I was building the second cart I was a bit paranoid about hackers so I created a non-root MySQL user with privileges only for that one DB, and those are the connection settings in configure.php. But then I remembered that I had actually gone back and retrofitted the first cart in the same way, so neither one is connecting as root, but the old cart works and the new one doesn't.

    Thanks for any assistance.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Backup MySQL Database: Result code: 2

    Tripple check the folder permissions where this is to be saved
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Backup MySQL Database: Result code: 2

    Put it into debug mode and let's see what else is happening behind-the-scenes:

    Open the MySQL Backup screen.
    Click on Backup
    change the URL by adding &debug=ON and press Enter
    Now click the Backup button in the sidebox.
    You should see a number of other status messages besides just the error you reported.
    If you post it here, be sure to obfuscate your database password.
    .

    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.

  4. #4
    Join Date
    Jan 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: Backup MySQL Database: Result code: 2

    The resulting output was:

    Code:
    Checking Path: /usr/bin/
    
    COMMAND FILES SELECTED:
    mysqlexe="/usr/bin/mysql"
    mysqldumpexe="/usr/bin/mysqldump"
    
    COMMAND: "/usr/bin/mysqldump" "--host=localhost" "--user=username" "--password=password" --opt --complete-insert "--result-file=/path/to/renamed/admindir/backups/db_my_database-20070802231551.sql" my_database 2>&1
    Result code: 2
    valueA:
    valueB:
    Failure: The database has NOT been saved.
    Also the permissions on the backups directory are set to 777.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Backup MySQL Database: Result code: 2

    Nothing obvious about the cause of the problem there.

    Edit the /admin/backup_mysql.php file .. around line 152 you'll see:
    Code:
            $resultcodes = @exec(OS_DELIM . $toolfilename . $dump_params . OS_DELIM, $output, $dump_results );
    remove the @ sign in @exec(
    Then try again. May want to do the debug=ON again.

    You'll want to undo that edit once things are working though.
    .

    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.

  6. #6
    Join Date
    Jan 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: Backup MySQL Database: Result code: 2

    Removed the @ and got the same output as before with debug ON. Without debug ON I just got the original two lines.

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

    Default Re: Backup MySQL Database: Result code: 2

    Quote Originally Posted by theapeman View Post
    Also, as it happens, I have two separate Zen Carts running on this particular server, each on its own database, and the backup DB module works fine on my other cart. Other than content, the only difference I'm aware of is that the cart giving me the problems is a new install of 1.3.7.1 whereas the one that works is plain old 1.3.7.
    There should be no differences in how this plugin works between v1.3.7 and v1.3.7.1.
    The module is compatible for all v1.2.x and v1.3.x releases.

    Quote Originally Posted by theapeman View Post
    At first I thought it might be my connection settings: Around the time I was building the second cart I was a bit paranoid about hackers so I created a non-root MySQL user with privileges only for that one DB, and those are the connection settings in configure.php. But then I remembered that I had actually gone back and retrofitted the first cart in the same way, so neither one is connecting as root, but the old cart works and the new one doesn't.
    What are all the rights/permissions/grants settings for each of the database users ?

    What happens if you grant user A to database B, and then use user A info in the site B admin/includes/configure.php ?
    .

    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.

 

 

Similar Threads

  1. Backup MySQL Database
    By rued in forum Addon Admin Tools
    Replies: 264
    Last Post: 26 Jul 2023, 12:28 AM
  2. Replies: 5
    Last Post: 28 Sep 2010, 05:34 AM
  3. backup mysql tools but got errors:Result code: 2
    By newuser123 in forum All Other Contributions/Addons
    Replies: 12
    Last Post: 18 Apr 2010, 09:48 PM
  4. Backup MySQL Database vs using cPanel backup option?
    By IronMan101 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 30 Jul 2007, 08:46 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