Get started with Atlassian Analytics
Learn how to add Atlassian Analytics to a site and understand what you need to query data and create charts.
To connect your MySQL database to Atlassian Analytics, you’ll need to do the following:
Allow your MySQL user to connect from Atlassian IP addresses.
Grant your MySQL user access to the necessary tables in your schema.
Complete the connection form in Atlassian Analytics.
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.
After you’ve created your database user, you’ll need to grant that user read-only access to the necessary tables in your schema.
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.
To grant your database user the necessary read-only access to only specific tables in your database:
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.
Run the GRANT statement for every table in the database that you want the user to access.
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.
Run FLUSH PRIVILEGES to make the changes take effect.
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:
Select Data from the global navigation.
Select Add data source > MySQL.
Fill out the required fields of the connection form:
Hostname or IP - Where your database is hosted.
Port - Default port number for MySQL is 3306.
Username - Username of the MySQL read-only user you created.
User password - Password of the MySQL read-only user you created.
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.
Refer to the MySQL documentation for instructions on how to create a certificate and SSL connection.
Was this helpful?