PHP code example of tradesy / innobackupex

1. Go to this page and download the library: Download tradesy/innobackupex library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tradesy / innobackupex example snippets




l_host = "127.0.0.1";   /* this should be localhost (IP since not using unix socket) because we are connecting via ssh below */
$mysql_user = "root";
$mysql_password = "password";
$mysql_port = 3306;


// Create MySQL configuration object
$mysql_config = new \Tradesy\Innobackupex\MySQL\Configuration (
    $mysql_host,
    $mysql_user,
    $mysql_password,
    $mysql_port
);

$algorithm = "AES256";         /* Currently Supported:        "AES128", "AES192", "AES256" */
$key = "MY_STRING_ENCRYPTION_KEY"; 


// Create Encryption Configuration Object
$encryption_configuration = new \Tradesy\Innobackupex\Encryption\Configuration(
    $algorithm,
    $key 
);

 /*
  *   First get files present on backup server
  */
 $info = $Backup->fetchBackupInfo();
 


$connection = new \Tradesy\Innobackupex\LocalShell\Connection();
$connection->setSudoAll(true);