MySQL Router 8.0  /  ...  /  mysqlrouter_keyring — Command Line Options

4.3.1.4 mysqlrouter_keyring — Command Line Options

The mysqlrouter_keyring utility is a a command line application to manage MySQL Router key rings.

Note

This feature was added in MySQL Router 8.0.18.

Usage information:

Generic commands

  • --help: usage information.

  • --version: the tool's version.

Keyring commands; all commands also accept --master-key-reader and --master-key-writer instead of --master-key-file.

  • --init: Initialize keyring with a master-key-file.

    Creates a keyring and master-key-file if they doo not exist; and adds keyring to master-key-file if it does not yet exist there.

  • --list: List usernames stored in the keyring; or list properties of a user stored in the keyring.

  • --get: Get property of user from the keyring.

  • --export: Export keyring as JSON.

  • --set: Set property in the keyring.

  • -delete-: Delete user from the keyring.

Master-key commands

  • --master-key-list: List keyring-ids from master-key-file.

  • --master-key-delete: Delete master-ley from "keyring" from master-key-file.

  • --master-key-rename: Rename keyring-id in a master-key-file.

Examples:

shell> mysqlrouter_keyring init --master-key-file=mysqlrouter.key data/keyring
    
shell> mysqlrouter_keyring list --master-key-file=mysqlrouter.key data/keyring
shell> mysqlrouter_keyring list --master-key-file=mysqlrouter.key data/keyring user   

shell> mysqlrouter_keyring get --master-key-file=mysqlrouter.key data/keyring someuser key

shell> mysqlrouter_keyring export --master-key-file=mysqlrouter.key data/keyring

shell> mysqlrouter_keyring set --master-key-file=mysqlrouter.key data/keyring user key value

shell> mysqlrouter_keyring delete --master-key-file=mysqlrouter.key data/keyring user
shell> mysqlrouter_keyring delete --master-key-file=mysqlrouter.key data/keyring user key

shell> mysqlrouter_keyring master-key-list --master-key-file=mysqlrouter.key

shell> mysqlrouter_keyring master-key-delete --master-key-file=mysqlrouter.key data/keyring 

shell> mysqlrouter_keyring master-key-rename --master-key-file=mysqlrouter.key data/keyring other/data/keyring