Generic MySQL

MySQL is the most popular Open Source Relational SQL Database Management System used by small and large businesses. It has a customizable software and works well even with large data sets.

You can ingest data from your MySQL database using Hevo Pipelines and replicate it to a warehouse of your choice.


Perform the following steps to configure your Generic MySQL Source:

Set up MySQL Binary Logs for Replication

A binary log is a collection of log files that records information about data modifications and data object modifications made on a MySQL server instance. Typically binary logs are used for data replication and data recovery.

Hevo supports data ingestion for replication from MySQL servers via binary logs (BinLog). For this, binary logging must be enabled on your MySQL server. You can do this via the MySQL server configuration file or via server startup options to mysqld.

Follow these steps to set up BinLog replication:

1. Check if BinLog replication is already enabled

  1. Access the MySQL database you want to check for BinLog activity:

     mysql -h hostname -u user -p database
  2. Open a secure shell:

     ssh user@localhost
  3. Enter the command:

    select @@log_bin;

    If this statement returns a value of 1, BinLog is active. If value returned is 0, this means that BinLog is disabled. To enable it, follow the steps below.

2. Enable BinLog replication

  1. Log in to your MySQL server instance.

  2. Check your MySQL Server configuration:

    sudo nano /etc/mysql/my.cnf

    This may be sudo nano /etc/my.cnf in some cases.

  3. In the config file, ensure the following configurations are specified. If not specified, add them now.

     expire_logs_days=3  -- The retention period (`expire_log_days`) can also be set in seconds by using the command: `binlog_expire_logs_seconds=259200`
     log_bin=mysql-binlog  -- For ubuntu, use: `/var/log/mysql/mysql-bin.log` 
     server-id=1 -- (only in the case of ubuntu) 

    Note: The log_slave_updates setting is required only if you are connecting a read replica. When it is set to 1, updates received by a replica server from a source server are logged to the replica’s own binary log.

  4. Restart the MySQL server using the command service mysql restart on your instance.

  5. After restart, log in to the MySQL server to check BinLog again:

     SELECT @@log_bin;

    The value returned is now 1, indicating that BinLog is active.

    Note: The retention period should ideally be at least 72 hours (3 days). This helps Hevo ensure that no log-file is missed from being read, specially when Historical Data loading is enabled. Read BinLog Alerts.

Read BinLog Replication and BinLog Alerts.

The replication reference guide on MySQL’s documentation portal provides a complete reference of the options available for replication and binary logging.

Whitelist Hevo’s IP Addresses

You need to whitelist the Hevo IP address for your region to enable Hevo to connect to your MySQL database. To do this:

  1. Edit the MySQL server configuration:

     sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
  2. Scroll to [mysqld] and add:

     bind-address =


     bind-address =

    (Check the Hevo IP address for your region).

  3. Save the file.

Grant Privileges to the User

The database user specified in the Hevo Pipeline must have the following global privileges:



To set up these privileges:

  1. Go to your mysql server. For example: mysql -u root -p.

  2. Grant SELECT privileges to the user using following command:

    GRANT SELECT ON *.* to jacob@localhost;
  3. (Optional) View the grants for the user with the following command:

    show grants for jacob@localhost;

Specify MySQL Connection Settings

In the Configure your MySQL Source page, specify the following:

Generic MySQL settings

  • Pipeline Name: A unique name for your Pipeline.

  • Database Host: The MySQL host’s IP address or DNS.

    The following table lists a few examples of MySQL hosts:

    Variant Host
    Amazon RDS MySQL
    Azure MySQL
    Generic MySQL or
    Google Cloud MySQL

    Note: For URL-based hostnames, exclude the http:// or https:// part. For example, if the hostname URL is, enter

  • Database Port: The port on which your MySQL server is listening for connections. Default value: 3306.

  • Database User: The authenticated user who has the permissions to read tables in your database.

  • Database Password: The password for the database user.

  • Select an Ingestion Mode: The desired mode by which you want to ingest data from the Source. The available Ingestion Modes are Binlog, Table, and Custom SQL. Read Ingestion Modes.

    For Ingestion mode as Table, read Object Settings for steps to configure the objects to be replicated.

  • Database Name: The database you want to load data from if the Pipeline mode is Table or Custom SQL.

  • Connection Settings

    • Connect through SSH: Enable this option to connect to Hevo using an SSH tunnel, instead of directly connecting your MySQL database host to Hevo. This provides an additional level of security to your database by not exposing your MySQL setup to the public. Read Connecting Through SSH.

      If this option is disabled, you must whitelist Hevo’s IP addresses. Refer to the content for your MySQL variant for steps to do this.

    • Use SSL: Enable it to use SSL encrypted connection. To enable this, specify the following:

      • CA File: The file containing the SSL server certificate authority (CA).

      • Client Certificate: The client public key certificate file.

      • Client Key: The client private key file.

  • Advanced Settings

    • Load All Databases: Applicable for Pipelines with BinLog mode. If this option is enabled, Hevo loads the data from all databases on the selected host. Else, specify a comma-separated list of Database Names you want to load data from.

    • Load Historical Data: Applicable for Pipelines with BinLog mode. If this option is enabled, the entire table data is fetched during the first run of the Pipeline. If disabled, Hevo loads only the data that was written in your database after the time of creation of the Pipeline.

    • Merge Tables: Applicable for Pipelines with BinLog mode. If this option is enabled, Hevo merges tables with the same name from different databases while loading the data to the warehouse. Hevo loads the Database Name field with each record. If disabled, the database name is prefixed to each table name. Read How does the Merge Tables feature work?.

    • Include New Tables in the Pipeline: Applicable for all Ingestion modes except Custom SQL.

      If enabled, Hevo automatically ingests data from tables created in the Source after the Pipeline has been built. These may include completely new tables or previously deleted tables that have been re-created in the Source.

      If disabled, new and re-created tables are not ingested automatically. They are added in SKIPPED state in the objects list, in the Pipeline Overview page. You can update their status to INCLUDED to ingest data.

      You can change this setting later.

Click TEST & CONTINUE to proceed for setting up the Destination.

Connecting to a Local Database

Refer to this section for steps to connect to your local database. For detailed information and troubleshooting help, read Connecting to a Local Database.


  • MY-SQL/MS-SQL service is running on your local machine.

  • Data to be loaded to the Destination is available in your MY-SQL/MS-SQL database.

  • You have an account on ngrok and an installed ngrok utility on your local machine. To run ngrok on your local machine, follow these one-time steps:

    1. Extract the ngrok utility:

      • On Linux or MacOS, unzip ngrok from a terminal:

        unzip /path/to/
      • On Windows, double-click to extract it.

    2. Authenticate ngrok in your local machine:

      ./ngrok authtoken <your_auth_token>

      You can get the auth token from your ngrok dashboard. For example, in the image below, the auth_token starts with 1t7uGaJshUvnh2Fg1MApl.

      Auth token

Connect to the local database

Perform the following steps to connect to the local database:

  1. Log in to your database server.

  2. Start a TCP tunnel forwarding to your database port.

    ./ngrok tcp <your_database_port>

    For example, the port address for MySQL is 3306. Therefore, the command would be:

    ./ngrok tcp 3306
  3. Copy the public IP address (hostname and port number) for your local database and port. For example, in the image below, is the database hostname and 19789 is the port number.

    Getting hostname and port

  4. Paste the hostname and port number into the Database Host and Database Port fields respectively.

    MySQL settings

  5. Specify all other settings and click TEST & CONTINUE.


  • Hevo only fetches tables from the MySQL database. It does not fetch other entities such as functions, stored procedures, views, and triggers.

    To fetch views, you can create individual Pipelines in Custom SQL mode. However, some limitations may arise based on the type of data synchronization, the query mode, or the number of Events. Contact Hevo Support for more details.

See Also

Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Apr-21-2022 1.86 Updated section, Specify MySQL Connection Settings.
Aug-09-2021 NA Added a note in Step 3 of section, Enable BinLog replication.
Jul-26-2021 1.68 Added a note for the Database Host field.
Jul-12-2021 1.67 Added sections:
- Specify MySQL Connection Settings and
- Connecting to a Local Database .
Last updated on 21 Apr 2022