Connecting a MySQL Database



Connect to MySQL

Here is what you need to connect:

  • Read-only user (Username field)
  • Whitelist the bipp IP address if you are using a Direct Secure Connection mode.
  • Connection to SQL Hosting Platform: Google Cloud SQL, Microsoft Azure or Amazon RDS.
  • Database connection information
  • Credentials

Create a MySQL read-only User

bipp recommends using a read-only user for connecting to your MySQL databases.

You must have the GRANT OPTION privilege and the privileges you are granting. For more details, refer to your MySQL documentation.

On a MySQL command line or shell, enter:

ON 'my_database'.*
TO 'my_user'@'ip_address' IDENTIFIED BY 'my_password';
  • my_database the database name where you are granting permissions.
  • my_user the read-only user name you are creating.
  • my_password the password for the read-only user.
  • ip_address the IP address for the connection. You have options:
    1. If your database is accessible via the internet, you can use % for the IP address and set the Connection type to Direct Connection.
    2. bipp recommends using the bipp static IP address to only allow a bipp connection to the database. Set the Connection type to Direct Secure Connection, and whitelist the bipp IP address.

This grants the user read-only access to all tables in your database.

Whitelist the bipp IP address

If your MySQL instance is behind the firewall, you need to whitelist the bipp IP Address to allow bipp to connect to your database. Use Direct Secure Connection as the Connection type when you create the datasource.

Create a MySQL Datasource in bipp

  1. Select Datasources from the Home Navigation pane to open the Datasources page.

    Datasource Page

  2. Click New Datasource on the Datasources page.

    New Datasource

  3. Enter a Name. For example, TestMySQL.

  4. Select MySQL for SQL Dialect for your database. bipp creates and enforces the rules for the selected dialect.

    Datasource MySQL

  5. Enter the information for your MySQL database instance:

    • Host: name or IP address of the database host.
    • Port: port on the host for the connection.
    • Username: user name for the connection. bipp recommends using a read-only user account.
    • Password: password for the user.
    • Database: name of the database for the connection.
    • Connection: connection type
      • Direct Connection: database directly available over internet or your bipp platform is deployed on-premise in a private subnet.
        • UseTLS: enable Transport Layer Security for the connection. bipp recommends you select yes to use TLS.
        • SslCert: browse to the location of the PEM format file containing your X509 certificate. This certification identifies the MySQL daemon to clients during TLS/SSL connections.
        • SslKey: browse to the location of your SSL key.
        • SslRootCert: browse to the location of your SSL Root certificate.
      • Direct Secure Connection: secured encrypted TCP connection if your database is behind a firewall. Whitelist the bipp IP address TLS is not supported in this mode. The encrypted data is transmitted to prevent in-transit eavesdropping.
      • SSH Tunnel: encrypted connection using Datasource MySQL SSH Port Forwarding. bipp supports both forward and reverse SSH tunnels. You can use the SshTunnelAuth to specify Key or Password for the authorization type. Here are the additional SSH fields:
        • SshTunnelHost: name or IP address of the SSH tunnel authentication host.
        • SshTunnelPort: port on the SSH tunnel authentication host for the connection.
        • SshTunnelUser: user name for SSH tunnel authentication.
        • Ssh TunnelAuth: select Key to use an SSH Private Key and optional SSH Passphrase, or select Password to use your SSH Password.
  6. Click Test to verify the datasource connectivity. If you have an error, fix the connection or credentials problem and click Test again.

  7. Click Create to add the datasource.

Congratulations! You have successfully created a MySQL datasource in bipp.