Essentials
...
Code Block | ||
---|---|---|
| ||
-- check if user exists SELECT EXISTS(SELECT 1 FROM `mysql`.`user` WHERE `user` = 'blbackup' AND `host` = '%') AS 'BackupUserExists 1=Yes'; -- create the user if it doesn't exist CREATE USER 'blbackup'@'%' IDENTIFIED AS '*4D8DE8683A65AFAB16B91226426A0D9116C664D6pwd-hashed'; -- Add a WITH clause if necessary: WITH caching_sha2_password -- it goes after IDENTIFIED: WITH mysql_native_password -- grant privileges to user (can be more limited if you prefer - see notes below) GRANT REPLICATION SLAVE ON *.* TO 'blbackup'@'%'; GRANT REPLICATION CLIENT ON *.* TO 'blbackup'@'%'; GRANT SELECT, SHOW VIEW, EVENT, TRIGGER, SHOW DATABASES, RELOAD ON *.* TO 'blbackup'@'%'; |
...
If dumping all databases at once
SHOW DATABASES
If pulling master data from a server
RELOAD
Flow User Sample
Create a user with all the necessary privileges to install and run Flow for Chameleon. SUPER privilege is not required assuming server is configured correctly (need log_bin_trust_function_creators=1 set when bin logging enabled.) The use of 127.0.0.1 instead of localhost below is used to enable connecting to a second instance of MySQL on a non-default port. If you use localhost the MySQL command line interface ignores any other port specification and always uses the default 3306 port.
...