• Products
  • Documentation
  • Resources

Connect to MySQL

To connect your MySQL database to Atlassian Analytics, you’ll need to do the following:

  1. Allow your MySQL user to connect from Atlassian IP addresses.

  2. Grant your MySQL user access to the necessary tables in your schema.

  3. Complete the connection form in Atlassian Analytics.

Allow your MySQL user to connect from Atlassian IP addresses

Before you connect your MySQL database to Atlassian Analytics, you’ll need to allow Atlassian IP addresses for outbound connections. Get the list of Atlassian IP addresses for outbound connections.

This ensures that Atlassian Analytics can successfully send your queries to your database.

We highly recommend you create a specific read-only user that you’ll use to connect your MySQL database to Atlassian Analytics. You’ll need to configure this user so it can connect from our IP addresses. The simplest way to do this is to use a bind address of 0.0.0.0 so the user can listen to all network interfaces.

Use the following CREATE statement to make your new user:

CREATE USER user_name@`0.0.0.0` IDENTIFIED BY 'password';

where you’ll replace user_name and password with the credentials you want to use.

Refer to the MySQL documentation for more information about creating a user that connects from specific IP addresses.

Grant user access to tables in your MySQL database

After you’ve created your database user, you’ll need to grant that user read-only access to the necessary tables in your schema.

Grant access to all tables

To grant your database user the necessary read-only access to all tables in your database, make sure to include the SELECT and SHOW VIEW privileges in the GRANT statement.

For example, the GRANT statement could look like:

GRANT SELECT, SHOW VIEW ON database_name.* TO user_name@`0.0.0.0`

where database_name and user_name are replaced with your specific details.

Grant access to specific tables

To grant your database user the necessary read-only access to only specific tables in your database:

  1. Use the following format for your GRANT statement:
    GRANT SELECT, SHOW VIEW ON database_name.`table_name` to 'user_name'@`0.0.0.0`;
    where database_name, table_name, and user_name are replaced with your specific details. Refer to the MySQL documentation for more details about GRANT privileges.

  2. Run the GRANT statement for every table in the database that you want the user to access.

  3. Give the user a secure password:
    SET PASSWORD FOR 'user_name'@`0.0.0.0` = PASSWORD('your_password');
    where user_name and your_password are replaced with your specific details.

  4. Run FLUSH PRIVILEGES to make the changes take effect.

Connect MySQL to Atlassian Analytics

After creating and configuring a read-only database user to communicate from our outbound IP addresses, you can complete the connection form in Atlassian Analytics to add your MySQL database.

To add MySQL to Atlassian Analytics:

  1. Select Data from the global navigation.

  2. Select Add data source > MySQL.

  3. Fill out the required fields of the connection form:

    1. Hostname or IP - Where your database is hosted.

    2. Port - Default port number for MySQL is 3306.

    3. Username - Username of the MySQL read-only user you created.

    4. User password - Password of the MySQL read-only user you created.

    5. Database name - Name of your MySQL database.

Atlassian Analytics will connect with your database to get your schema, then your data source will be ready to use.

MySQL SSL connection

Refer to the MySQL documentation for instructions on how to create a certificate and SSL connection.

Additional Help