Tonic
Search…
MySQL / MariaDB
Below you will find details on how to create a tonic user on both the source and destination databases with the minimum level of permissions needed for Tonic to function.

Source Database

The following is an example of how to create a new user, called tonic, and grant necessary permissions. For the source database we recommend using a backup or fast follower database instead of connecting directly to your production environment.
1
--create a user. '%' matches a user coming from any host.
2
CREATE USER 'tonic'@'%' IDENTIFIED BY 'tonic_password';
3
4
--give the user access to schema information
5
GRANT PROCESS ON *.* TO tonic;
6
7
--give the user access to tables in your preferred DBs
8
GRANT SELECT, SHOW VIEW ON preferred_db.* TO tonic;
Copied!

Destination Database

1
--create a new user.
2
CREATE USER 'tonic'@'%' IDENTIFIED BY 'tonic_password';
3
4
5
--This user must be granted access to everything. Amazon RDS handles this differently than vanilla MySQL
6
7
--On Amazon RDS
8
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'tonic'@'%' WITH GRANT OPTION;
9
10
--On vanilla MySQL
11
GRANT ALL PRIVILEGES ON * . * TO 'tonic'@'%';
Copied!
Last modified 3mo ago