Connect to MySQL
Connecting to MySQL isn’t available in the Atlassian Government environment.
To connect your MySQL database to 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 Analytics.
Allow your MySQL user to connect from Atlassian IP addresses
Before you connect your MySQL database to 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 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 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.
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:
Use the following format for your
GRANTstatement:GRANT SELECT, SHOW VIEW ON database_name.`table_name` to 'user_name'@`0.0.0.0`;
wheredatabase_name,table_name, anduser_nameare replaced with your specific details. Refer to the MySQL documentation for more details about GRANT privileges.Run the
GRANTstatement 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');
whereuser_nameandyour_passwordare replaced with your specific details.Run
FLUSH PRIVILEGESto make the changes take effect.
Connect MySQL to Analytics
After creating and configuring a read-only database user to communicate from our outbound IP addresses, you can complete the connection form in Analytics to add your MySQL database.
To add MySQL to 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.
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.
Was this helpful?