Create a basic dashboard in Tableau using MySQL
Create a basic dashboard in Tableau using MySQL
06 January 2022
Prerequisites
- Tableau server installation
- A MySQL server that hosts the database that you want to connect to Tableau
- Credentials of the MySQL server
- Basic schema to execute initial sql statements
- MySQL drivers installed on the Tableau server
- License of MySQL driver on the Tableau server
Steps to connect MySQL database
-
Create new workbook
-
Select Data Connector
-
Set up and connect to the database
-
Select database from the drop-down list of available databases
-
Create Custom SQL query to create a defined data source
-
Creating the worksheet to display data
After logging into the Tableau server you will find an option to create a new project or workbook. You can select the option as per your requirements. If you create a new project, you will also need to create a new workbook in it.
Data Connectors in Tableau are basically different sources of data with which you can connect. You can find the different data connectors available on Tableau Server in the below image. For every data connector, we need to have the connector drivers installed on the server. To use any of the data connectors we also need to have the license for it. The license keys can be activated on the server from the Tableau Services Manager which is configured during the server installation.
After selecting the MySQL option from the connectors page, you will see a pop-up to enter your server credentials to connect to the server as shown below.
After connecting to the server, you will find a drop-down to select from the database available on the server. You can see the below view after selecting the database.
After connecting to your data, double-click on the New Custom SQL option on the Data Source page.
Enter the custom query into the Edit Custom SQL pop-up as shown below.
After creating the custom sql query, you can see the data as in the below image.
We can also edit the data source column names as per our requirements. It also provides options to sort the data and to change the datatype.
From the bottom navigation bar, you can see the tabs for Data Source and Sheet1. We need to create the view in the sheet. We can rename the sheet as per our needs.
After selecting the sheet you can see the folders available in the data source on the left. It contains all the fields that are present in the data source ex. First Name, Last Name. There are other formatting options available to design the view.
We need to add the field names into the rows section to show the data. After dragging the fields you can see the data as below. You can save the worksheet and share it with different users present on the server.
You can save change the color scheme of the view and also apply different design patterns. Tableau provides different layouts depending on the properties of the data that you want to show. You can see the layouts in the below image.
If you want to know more about Creating dashboards in Tableau you can visit Tableau’s official website.