Create a database user and provide the user with READ access to all the resources which need to be migrated. Replace <client_IP> from the following commands with an appropriate hostname in your setup.

  1. Create a new user ybvoyager.

    CREATE USER 'ybvoyager'@'<client_IP>' IDENTIFIED WITH  mysql_native_password BY 'Password#123';
    
  2. Grant the global PROCESS permission.

    GRANT PROCESS ON *.* TO 'ybvoyager'@'<client_IP>';
    
  3. Grant the SELECT, SHOW VIEW, and TRIGGER permissions on the source database:

    GRANT SELECT ON source_db_name.* TO 'ybvoyager'@'<client_IP>';
    GRANT SHOW VIEW ON source_db_name.* TO 'ybvoyager'@'<client_IP>';
    GRANT TRIGGER ON source_db_name.* TO 'ybvoyager'@'<client_IP>';
    

    Note that if you want to accelerate data export, include the following grants additionally as follows:

    For MYSQL

    GRANT FLUSH_TABLES ON *.* TO 'ybvoyager'@'<client_IP>';
    GRANT REPLICATION CLIENT ON *.* TO 'ybvoyager'@'<client_IP>';
    

    For MYSQL RDS

    GRANT FLUSH_TABLES ON *.* TO 'ybvoyager'@'<client_IP>';
    GRANT REPLICATION CLIENT ON *.* TO 'ybvoyager'@'<client_IP>';
    GRANT LOCK TABLES ON <source_db_name>.* TO 'ybvoyager'@'<client_IP>';
    
  4. If you are running MySQL version 8.0.20 or later, grant the global SHOW_ROUTINE permission. For older versions, grant the global SELECT permission. These permissions are necessary to dump stored procedure/function definitions.

    --For MySQL >= 8.0.20
    GRANT SHOW_ROUTINE  ON *.* TO 'ybvoyager'@'<client_IP>';
    
    --For older versions
    GRANT SELECT ON *.* TO 'ybvoyager'@'<client_IP>';
    

    The ybvoyager user can now be used for migration.

If you want yb-voyager to connect to the source database over SSL, refer to SSL Connectivity.