It is used to set up initial user to login compute node, and authority data of storage node.
rules:
- !AUTHORITY
users:
- # Username, authorized host and password for compute node. Format: <username>@<hostname>:<password>, hostname is % or empty string means do not care about authorized host
provider:
type: # authority provider for storage node, the default value is ALL_PRIVILEGES_PERMITTED
rules:
- !AUTHORITY
users:
- root@localhost:root
- my_user@:pwd
provider:
type: ALL_PRIVILEGES_PERMITTED
rules:
- !AUTHORITY
users:
- root@:root
- my_user@:pwd
provider:
type: SCHEMA_PRIVILEGES_PERMITTED
props:
user-schema-mappings: root@=sharding_db, root@=test_db, my_user@127.0.0.1=sharding_db
The above configuration means:
root
can access sharding_db
when connecting from any hostroot
can access test_db
when connecting from any hostmy_user
can access sharding_db
only when connected from 127.0.0.1Refer to Authority Provider for more implementations.