Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. NetBackup™ Commands Reference Guide
  3. Appendix A. NetBackup Commands
  4. nbmysql
NetBackup™ Commands Reference Guide

Name

nbmysql — performs backup, query, restore, and delete operations for NetBackup MySQL clients.

SYNOPSIS

nbmysql -o backup -S primary_server_name -P policy_name -s schedule_name -l mysql_library_path -z lvm_snapshot_size [-C client_server_name] [-b backup_type] [-d backup_directory_path] [-dbname database_name] [-p mysql_server_port] [-u mysql_server_user] [-H mysql_server_host] [-instance mysql_instance_name] [-pgid provider_generated_id]

nbmysql -o query -S primary_server_name [-u mysql_server_user] [-P policy_name] [-C client_server_name] [-instance mysql_instance_name]

nbmysql -o restore -S primary_server_name -p mysql_server_port -t target_restore_directory [-u mysql_server_user] [-C client_server_name] [-H mysql_server_host] [-i backup_image_id]

nbmysql -o delete -S primary_server_name -i backup_image_id

On UNIX systems, the directory path to this command is /usr/openv/netbackup/bin

On Windows systems, the directory path to this command is install_path\NetBackup\bin

DESCRIPTION

Use the nbmysql command to backup, restore, query, and delete NetBackup MySQL client backups from the NetBackup client. The delete option removes the backup information from the NetBackup catalog files but retains the backups in the storage media.

OPTIONS

-b backup_type

Specifies the backup type to use for the backup operation. By default, the snapshot backup type is selected. Accepted values for -b are:

  • mysqldump: The MySQL utility performs the logical backup of the instance and databases. NetBackup performs streaming backups when the mysqldump type is specified. These backups change to non-streaming backups when the -d option is specified. This option is available for both UNIX and Windows systems.

  • vss: Snapshot backup type for Windows clients only.

  • lvm: Snapshot backup type for UNIX clients only.

-C client_server_name

Specifies the NetBackup client name. When you use this option with the -o query option, the operation retrieves and lists all backups from the specified NetBackup client.

-d backup_directory_path

Used to configure the backup directory path when you specify the -b mysqldump option. By specifying the -d option, the -b mysqldump backups are changed to non-streaming backups. Consistent backup files are generated in the backup directory path and are cleaned after the backup. Ensure that the directory path is empty. Any information in the specified directory is deleted.

-dbname database_name

Use this option with the -b mysqldump to specify the name of the database you want backed up. This option backs up an individual database.

-H mysql_server_host

Specifies the MySQL server host. The default value is localhost.

-i backup_image_id

Specifies the backup image ID. When you use this option with the -o delete operation, it specifies the backup image ID that is deleted from the NetBackup catalog. The backup image is not deleted.

-instance mysql_instance_name

Used to specify the MySQL server instance name. When you use this option with the -o query option, it retrieves and lists all backups of the specified instance name.

-l mysql_library_path

Specifies the MySQL library directory. This option is only available for UNIX clients.

-o operation_type

Specify the operation you want to perform. Valid operation types are:

  • backup: Used to backup MySQL instances and databases.

  • query: Used to query the NetBackup catalog for MySQL backups.

  • restore: Used to restore MySQL instances and database backups.

  • delete: Used to delete catalog information of MySQL backups.

-P policy_name

Used to specify the NetBackup DataStore policy name. When you use this option with the -o query option, the command retrieves and lists all backups with the specified policy name.

-p mysql_server_port

Specifies the MySQL instance port number that NetBackup uses for backup and restore operations. By default, the port number is 3306.

-pgid provider_generated_id

Configures the NetBackup provider-generated ID for the backup.

For a MySQL instance, the format of the -pgid must be in the form shown: MYSQL_INSTANCE_client_server_name_port.

For an individual MySQL database backup, the format of the -pgid must be in the form shown: MYSQL_DATABASE_database_name_client_server_name_port.

Follow this format to list the recovery points of backups in the NetBackup web UI.

-S primary_server_name

Specifies the NetBackup primary server name.

-s schedule_name

Specifies the schedule name that you have configured for the DataStore policy.

-t target_restore_directory

Configures the target directory where the backups are restored.

-u mysql_server_user

Specifies the name of the MySQL server user. The default user is root. When you use this option with the -o query option, this option retrieves and lists all backups for the specified user.

For UNIX computers, this parameter is an optional parameter for backup, restore, and query operations. The parameter is not available for the delete operation. For Windows computers, this parameter is optional for backup. The parameter is not available for restore, query, and delete operations.

-z lvm_snapshot_size

Configures the LVM snapshot size. This option is only available for UNIX clients.

EXAMPLES

Example 1: Perform a mysqldump non-streaming backup.

# nbmysql -o backup -S Primary_Server1 -P Policy1 -s Schedule1 -l 
/path/to/pgsql/lib -C Client_Server1 -b mysqldump -d /backup/dir/path 
-p 3306 -u root -H localhost -instance mysql-linux-3306 -pgid 
MYSQL_INSTANCE_Client_Server1_3306

Example 2: Perform a streaming backup of an individual database.

# nbmysql -o backup -S Primary_Server1 -P Policy1 -s Schedule1 -l 
/path/to/pgsql/lib -C Client_Server1 -b mysqldump -dbname Database_Name1 
-p 3306 -u root -H localhost -instance mysql-linux-3306 -pgid 
MYSQL_DATABASE_Database_Name1_Client_Server1_3306

Example 3: Perform a UNIX restore.

# nbmysql -o restore -S Primary_Server1 -p 3306 -t
/target/restore/directory -u root -C Client_Server1 -H localhost
-i 1768656897

Example 4: Perform a query for Windows.

nbmysql -o query -S Primary_Server1 -P Policy_Name1 -C 
Client_Server1 -instance mysql-linux-3306

SEE ALSO

See nbpgsql.

See nbsqlite.

See nbmariadb.

Feedback

Was this page helpful?
Previous

nbmariadb

Next

nbmlb

Feedback

Was this page helpful?