Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Essentials

...

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.

Code Block
languagesql
CREATE USER 'FLOW'@'127.0.0.1' IDENTIFIED  BY 'password'; -- WITH caching_sha2_password

GRANT
    ALTER,
    ALTER ROUTINE,
    CREATE,
    CREATE ROUTINE,
    CREATE TEMPORARY TABLES,
    CREATE VIEW,
    DELETE,
    DROP,
    EXECUTE,
    INDEX,
    INSERT,
    LOCK TABLES,
    REFERENCES,
    SELECT,
    SHOW VIEW,
    TRIGGER,
    UPDATE
ON superticker.*
TO 'FLOW'@'127.0.0.1';

GRANT SELECT ON `mysql`.*
TO 'FLOW'@'127.0.0.1';

GRANT 
    CREATE USER, 
    RELOAD
ON *.* 
TO 'FLOW'@'127.0.0.1' WITH GRANT OPTION;

flush privileges;

FLOW user and Stored Procedures error

If you try to run the procedure scripts with a FLOW user but they were originally created by the root user then you will get an error in MySQL 8.0.16 or greater. The error will tell you you need the SYSTEM_USER privilege. To resolve - you can temporarily assign the SYSTEM_USER privilege to allow the FLOW user to drop the code created by root and recreated them. Once created by FLOW the user retains the right to drop them in the future.

Code Block
languagesql
GRANT  SYSTEM_USER ON *.* TO 'FLOW'@'localhost';
... run stored procedure scripts ...
REVOKE  SYSTEM_USER ON *.* FROM 'FLOW'@'localhost';

Suspending Privileges

You may want to temporarily disable the access to the database. In that case you would use a REVOKE command:

...