NetBackup™ Web UI MySQL Administrator's Guide

Last Published:
Product(s): NetBackup & Alta Data Protection (10.3)
  1. Overview
    1.  
      Overview of NetBackup for MySQL
  2. Managing MySQL instances and databases
    1.  
      Quick configuration checklist to protect MySQL instances and databases
    2.  
      Configure MySQL instance
    3.  
      Add MySQL instance
    4.  
      Manage credentials for an instance
    5.  
      Discover MySQL databases
    6.  
      Remove MySQL instances
    7.  
      Change the autodiscovery frequency of MySQL assets
  3. Managing MySQL environment credentials
    1.  
      Add new MySQL credentials
    2.  
      Default MySQL Administrator
    3.  
      Validate credentials of MySQL instance
    4.  
      View the credential name that is applied to an asset
    5.  
      Edit or delete a named credential
  4. Protecting MySQL instances and databases
    1.  
      Things to know before you protect MySQL instances and databases
    2.  
      Protect MySQL instances and databases
    3.  
      Customize protection settings for the MySQL assets
    4.  
      Remove protection from MySQL instances
    5.  
      View the protection status of MySQL instance
  5. Restoring MySQL instances and databases
    1.  
      Things to know before you restore the MySQL instances and databases
    2.  
      About the pre-restore check
    3.  
      Restore a MySQL instance and database
    4.  
      Restore target options
    5.  
      Pre-restore checks for MySQL
    6.  
      Steps to perform recovery after restore operation
    7.  
      Limitations
  6. Troubleshooting MySQL operations
    1.  
      Troubleshooting tips for NetBackup for MySQL
    2.  
      Error during MySQL credential addition
    3.  
      Error during the MySQL instances and databases discovery phase
    4.  
      Error during the MySQL Protection Plan Creation
    5.  
      Error while subscribing protection plan to MySQL asset
    6.  
      Error while removing MySQL asset
    7.  
      Error while backup of MySQL asset
    8.  
      Error while restoring MySQL asset image
  7. API for MySQL instances and databases
    1.  
      Using APIs to manage, protect or restore MySQL

Steps to perform recovery after restore operation

The procedure to perform post-recovery is as follows for various platforms:

For Windows (VSS):

  1. Go to Control Panel > System and Security > Administrative Tools > Services.
  2. Select MySQL service and stop it.
  3. Delete or move everything from the MySQL data directory.

    Note:

    Post restores, change the attributes of the restored data directory and files by using the following command.

    attrib -S restore_path/*.* /S /D

  4. Copy all the contents of the restored data directory to MySQL data directory.
  5. Delete all the temporary files from the data directory.

    For example:

    C:\ProgramData\MySQL\MySQL Server 8.0\Data\#innodb_temp.

    Delete undo_00x files from the data directory:

    For example:

    C:\ProgramData\MySQL\MySQL Server 8.0\undo_001

  6. Start MySQL service.

For Linux (LVM):

  1. Stop MySQL services.
  2. Copy all the contents of the restored data directory to MySQL data directory.
  3. Change ownership of the MySQL data directory.

    For example:

    chown -R mysql:mysql mysql_data_directory_path

  4. Start the MySQL service.

    Note:

    The binlogs from the incremental backups get restored to the target directory in the MyBINLOGS directory.

Recovery steps for incremental recovery

For the recovery from incremental backups, which contain binlogs, use the following command to replay binlogs:

  • For Windows:

    for /f "tokens=*" %i in ('dir "< restore_path\MyBINLOGS" /s /b') do (mysqlbinog "%i" | mysql -u user -P port -p)

  • For Linux:

    mysqlbinlog restore_directory/MyBINLOGS/* | mysql -u user -P port -p

Recovery Steps for backup done by mysqldump utility

Recover MySQL database using the mysqldump utility.

Recover single MySQL database.

The following examples of NetBackup commands are used mostly in the Windows and Linux platform.

  • For Windows:

    mysql --host=host --user=user --port=port -p database_name < restore_path\mysqlBackup_Dump_xxx.sqlx

  • For Linux:

    mysql --host=host --user=user --port=port -p database_name < restore_path\mysqlBackup_Dump_xxx.sqlx

Recover MySQL instance.

The following example commands create a single dump file containing all the databases.

  • For Windows:

    mysql --host=host --user=user --port=port -p < restore_path\mysqlBackup_Dump_xxx.sqlx

  • For Linux:

    mysql --host=host --user=user --port=port -p < restore_path\mysqlBackup_Dump_xxx.sqlx

Recovery steps for incremental recovery

For doing recovery from incremental backups which contain binlogs, use the following commands to replay the binlogs:

  • For Windows:

    for /f "tokens=*" %i in ('dir restore_path/s /b') do (mysqlbinog "%i" | mysql -u user -P port -p)

  • For Linux

    mysqlbinlog restore_directory/* | mysql -u user -P port -p

Steps to perform after Restore and Recovery in case of MySQL cluster deployment

  1. For MySQL cluster deployment, follow the following steps post Restore and Recovery:
    • For mysqldump backup, run following queries on replica:

      • STOP SLAVE;

      • SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 3;

      • START SLAVE;

  2. For snapshot, do the following steps :

    On source:

    • Run the command$ mysqldump -u user -p --all-databases --master-data > source-data.sql 2.

    • Copy source-data.sql file from source to replica host in the following ways:

      • For Linux

        $ scp source_data.sql host_user@ source_ip_address:destination_path

      • For windows

        Either use WinSCP or do it manually.

    On replica:

    • mysql -u user -P port -p < destimation_path_of_source-data.sql_file

    • Run the following MySQL queries:

      • On source:

        • reset master;

      • On replica:

        • stop slave;

        • reset slave;

        • reset master;

        • start slave;