Do you want to visualize your MySQL data in Tableau? Are you looking for a simple fix? If yes, you’ve landed on the right page! This article provides you with a step-by-step solution to help you connect MySQL to Tableau in a matter of minutes. 

This article aims at answering all your queries about connecting MySQL to Tableau. Follow our easy guide to master the skill of connecting MySQL to Tableau using various methods.

Table of Contents

Introduction to MySQL

MySQL to Tableau: MySQL Logo

MySQL is an open-source database management system that is distributed, supported and developed by Oracle Incorporation (INC). MySQL is a relational database which stores the data in the form of tables and views. It supports various database objects such as tables, stored procedures, functions, triggers, views, indexes, and even cursors.

MySQL database server runs comfortably on any laptop or desktop even with various web applications or servers installed on the system. MySQL database server is designed to support large databases which may contain data of many organizations. MySQL database servers support a wide range of functions and multiple web API’s.

It performs exceptionally well & securely accesses various databases on the internet. It ensures connectivity with servers and devices at all times.

For further information, you can check the official MySQL site here.

Introduction to Tableau

MySQL to Tableau: Tableau Logo

Tableau is a powerful business intelligence tool used to turn raw data into an understandable format. It is a tool popularly used to visualize data and can be understood even by a non-technical user. 

It creates visualizations with the help of dashboards and worksheets, this helps users perform real-time analysis in a very fast and secure manner. It doesn’t require any programming skill or technical background to operate it.

For further information on Tableau, you can check the official site here.

Methods to connect MySQL to Tableau

Method 1: Using Tableau’s MySQL Connector 

Tableau’s in-built MySQL connector conveniently establishes a connection with MySQL. You can easily set up a data source and use Tableau to visualize your data to perform a fruitful analysis for your business. This method requires you to install the MySQL ODBC driver.

Method 2: Using ODBC to connect MySQL to Tableau

ODBC drivers can also be used to establish a connection between MySQL & Tableau. The ODBC driver can add a data source such as MySQL and then connect with Tableau.

Method 3: Using Hevo, A No-Code Data Integration Platform

Use Hevo, A No-Code Data Integration Platform to connect MySQL with various other marketing applications to bring in integrated data in a matter of minutes and visualize it in your desired BI tool such as Tableau that too without writing a single line of code. Its fault-tolerant architecture ensures that the data is handled in a secure, consistent manner with zero data loss.

Get started with hevo for free

Method 4: Exporting MySQL data as CSV

One unique way to connect MySQL to Tableau is to export data from MySQL in CSV format and then use the Tableau text connector to analyse the data

Prerequisites

  • Working knowledge of MySQL.
  • MySQL clusters and database.
  • Working knowledge of Tableau.
  • Tableau installed at the host workstation.

Methods to connect MySQL to Tableau

There are many ways in which you can connect MySQL to Tableau:

Download the Whitepaper on Automating Data Integration
Download the Whitepaper on Automating Data Integration
Download the Whitepaper on Automating Data Integration
Learn the key benefits of automating Data Integration

Method 1: Using Tableau’s MySQL connector

Tableau’s in-built MySQL connector conveniently connects MySQL to Tableau. You can easily set up a data source and use Tableau to visualize your data to perform a fruitful analysis for your business.

This method requires you to install the MySQL ODBC driver. The ODBC driver allows tableau to interact with data stored in your MySQL database and hence perform analysis easily. The MySQL driver comes installed by default with Tableau v9.3 and above. Users supporting any previous versions of their system can download the driver from the official MySQL site here.

Follow the below mentioned steps to connect MySQL to Tableau:

Step 1: Configuring Tableau

Launch Tableau on your workstation and select MySQL from the connect column on the left. This will open a dialogue box where you need to provide the connection details for MySQL.

To connect with tableau, you will need to provide information about the server which hosts your database. If you want to connect to a contained database, you can also specify the name of the database.

MySQL to Tableau: Configuring MySQL connector in Tableau.

Click on Sign in to establish a connection. This will enable a connection without SSL. To establish an SSL enabled connection, click the Require SSL checkbox before you sign in.

If you want to run a specific SQL command every-time a new connection is established, you can use the Initial SQL option. This will open a dialogue box, where you can specify your desired SQL query.

MySQL to Tableau: Initial SQL.

For further information on the Initial SQL command, you check the official site here.

Step 2: Configuring Data Source

The data source page loads up after configuring the Tableau connector and successfully signing in. This is how the page looks like:

MySQL to Tableau: Tableau Workspace.

Select the data source name option and give a unique name to the database you are using. It’s considered a good practice to have a unique name as it makes it much easier for users to identify the database from which data is being fetched.

To select the desired schema, you can use the schema drop-down list from the column on the left. You can also perform a text-based search to find the desired option. Now similarly find and select the desired table and drag it onto the canvas.

MySQL to Tableau: Tableau Tables.

This is how you can connect MySQL with Tableau. Now click on the sheets tab to begin the analysis.

Custom SQL features can be used to focus on specific SQL statements, rather than querying the entire database. Click on the Custom SQL option from the panel on the left. A new dialogue box will now open up, where you can provide the query you want to execute.

MySQL to Tableau: Custom SQL.

You can learn more about using custom SQL here.

Step 3: Performing Analysis Using Tableau 

To visualize the data, click on the data option from the desktop menu bar and then select a table from the list of data sources (usually found at the bottom of the pop-up).

MySQL to Tableau: Selecting a table in Tableau.

Here we are selecting a table called clientid to visualize the data. Now from the menu bar, select dashboard and create a new dashboard. This will generate a simple bar graph for your data. 

MySQL to Tableau: Visualising Data in Tableau.

This is a simple example of how you can visualize data using Tableau. There are many ways in which you can experiment with data using Tableau’s interactive UI and easily manage your business requirements.

This is how you can connect and visualize data from MySQL in Tableau.

Limitations of this method:

  • MySQL often faces a connection issue with systems that have the firewall on. This prevents connecting with the default port.
  • Sometimes MySQL databases are configured to establish connections only with some specified IPs.
  • This method requires installing the MySQL ODBC driver beforehand, which requires you to make multiple configuration settings.
  • It is a must for all computers to be able to run the Tableau servers in case of a distributed installation.

Method 2: Using ODBC to connect MySQL to Tableau

ODBC drivers can also be used to connect MySQL to Tableau. The ODBC driver can add a data source such as MySQL and then connect with Tableau. 

This can be implemented using the following steps:

Step 1: Installing MySQL ODBC Driver and DSN Setup

Download the latest version of ODBC driver for MySQL on your system from the official MySQL site here.

Once the ODBC driver is installed on your system, launch it to start the DSN set up process. Choose the correct 64 or 32-bit version and select the System DSN tab. 

MySQL to Tableau: ODBC Connector,

Click on the add button and select the MySQL ODBC driver. You can either select the MySQL ODBC 8.0 ANSI driver or the MySQL ODBC 8.0 UNICODE driver. 

The ANSI driver delivers the best performance but has a limited character set. For the entire character set, use the UNICODE option.

MySQL to Tableau: Selecting MySQL Unicode ODBC Driver.

The MySQL DSN setup box will now appear, where you need to fill in details regarding the connection settings and authentication:

MySQL to Tableau: Configuring MySQL Connection.

Fill the necessary fields as follows:

  • Data Source: Give the name of the data source you want to connect to.
  • TCP/IP Server: Give the network name or IP address of the MySQL server.
  • Port: MySQL uses the port 3306 by default, however, you can fill in the correct port number as per your MySQL cluster.
  • Database: Give the name of your database.
  • User: Enter the username in the correct format to connect with the MySQL database.
  • Passwords: Enter your password here.
MySQL to Tableau: Adding Database name & Password.

To test the connection, click on the test button. If the connection is successful, a new dialogue box will open up as follows:

MySQL to Tableau: Succesful connection.

Step 2: Connecting to Tableau

Launch Tableau on your workstation and select other databases (ODBC) from the connect column on the left. This will open a dialogue box where you need to provide the connection details.

MySQL to Tableau: Selecting the ODBC Connector.

In the ODBC dialogue box, select the MySQL DSN from a drop-down list and click on ok.

MySQL to Tableau: Selecting the ODBC connector.

Select the data source name option and give a unique name to the database you are using. It’s considered a good practice to have a unique name as it makes it much easier for users to identify the database from which data is being fetched.

MySQL to Tableau: Connecting MySQL to Tableau.

To select the desired schema, you can use the schema drop-down list from the column on the left. You can also perform a text-based search to find the desired option. Now similarly find and select the desired table and drag it onto the canvas.

This is how you can use ODBC to connect MySQL to Tableau to run the powerful analysis.

Some limitations of this method:

  • This method sometimes requires using third-party tools, which essentially is an extra tool that needs to be maintained.
  • There is always confusion about choosing the right driver. The ANSI delivers in terms of performance however lacks the entire character set whereas the UNICODE driver contains the entire set but suffers on the performance end.
  • The ODBC driver needs to be compiled with the debug mode enabled.

Method 3: Using Hevo, A No-Code Data Integration Platform

Say goodbye to the tedious challenges of unifying your marketing data! Use Hevo Data to connect MySQL to Tableau. Hevo, a No-Code Data Integration Platform, to connect MySQL with various marketing applications to bring in integrated data in a matter of minutes and visualize it in Tableau. It is the ideal solution for creating a single source of truth for marketing. Hevo is fully managed and completely automates the process of not only bringing in your data from multiple sources but also transforming it into a cleaned and analysis-ready form without having to write a single line of code. Its fault-tolerant architecture ensures that the data is handled in a secure, consistent manner with zero data loss.

Sign up here for a 14-day free trial!

Gone are the days of sitting down and manually optimizing your data to get rid of inconsistencies, silos and managing data losses. Hevo takes care of all your data preprocessing needs and lets you focus on key business activities and develop a much powerful insight on how to generate more leads, retain customers and take your business to new heights of profitability.

Check out what makes Hevo amazing:

  • Real-Time Data Transfer: Hevo with its strong integration with 100+ sources, allows you to transfer marketing data quickly & efficiently. This ensures efficient utilization of bandwidth on both ends.
  • Data Transformation: It provides a simple interface to perfect, modify, and enrich the marketing data you want to transfer. 
  • Secure: Hevo has a fault-tolerant architecture that ensures that the data is handled in a secure, consistent manner with zero data loss.
  • Simplicity: Using Hevo is easy and intuitive, ensuring that your data is exported in just a few clicks. 
  • Completely Managed Platform: Hevo is fully managed. You need not invest time and effort to maintain or monitor the infrastructure involved in executing codes.
  • Live Support: The Hevo team is available round the clock to extend exceptional support to its customers through chat, email, and support calls.

Steps to use Hevo:

Hevo focuses on three simple steps to get you started:

  1. Connect: Connect Hevo with MySQL and various other sales & marketing data sources by simply logging in with your credentials.
  2. Integrate: Consolidate your marketing data from several sources in Hevo’s Managed Data Integration Platform and automatically transform it into an analysis-ready form.
  3. Visualize: Connect Hevo with your desired BI tool such as Tableau and visualize your unified marketing data easily to gain better insights.

Method 4: Exporting MySQL data as CSV

One unique way to connect MySQL to Tableau is to export data from MySQL in CSV format and then use the Tableau text connector to analyze the data.

This can be done using 2 simple steps:

Step 1: Export data as CSV using MySQL workbench

Launch MySQL workbench on your system and open the desired project. MySQL allows exporting data in the desired format using the table data export wizard.

.

Select the table you want to export using the navigator option and right-click on it. Select the table data export wizard option from the list of available options to begin the process.

A new dialogue box will now open up, representing the table and the columns that you want to export.

MySQL to Tableau: Selecting columns to export.

You can either select columns manually or use the select all option to choose all columns of the desired table. Click on next to start the process.

A new dialogue box will now open up, where you select the desired path & the data type you want to export in.

MySQL to Tableau: Selecting the export data type.

Tick the checkbox to export the files on your system. You can also monitor the export process from the dialogue box.

MySQL to Tableau: exporting data as a file.

This is how you can export data from MySQL on your system.

Step 2: Using Tableau’s Text connector

Open the Text connector in Tableau and select the exported data file from your system. Click on the info button, this will open up a new dialogue box as follows:

MySQL to Tableau: Tableau text connector.

Now fill the necessary fields as follows:

  • Field Separator: Select the character that is used to separate columns in the CSV file.
  • Text Qualifier: Specify the text qualifier that is being used in the file. 
  • Locale: Choose the language that is used to parse the file. Tableau uses these to separate the numbers.
  • Does the file include field names in the first row: Specify whether the selected text file contains column names in the first row or not. 

You will now get an output representing the data in a flattened way as follows:

MySQL to Tableau: Tableau tables.

Limitations of this method:

  • There are chances of the tables getting corrupted while exporting data using the MySQL workbench.
  • It is slightly complicated and often makes performing simple tasks difficult.
  • It doesn’t support all databases.

Conclusion

This article introduces you to the various methods that can be used to connect MySQL to Tableau.

visit our website to explore hevo

Hevo, a No-Code Data Integration Platform helps you connect MySQL to various marketing data sources and store integrated marketing data in one place and visualize it in Tableau. Hevo with its strong integration with 100+ sources & BI tools, allows you to not only export & load marketing data but also transform & enrich your data & make it analysis-ready in a jiffy. 


Want to take Hevo for a spin? sign up here for a 14-day free trial!

Tell us about your experience of connecting MySQL to Tableau in the comments section below.

Divij Chawla
Former Marketing Operations and Analytics Manager, Hevo Data

Divij Chawla worked with Hevo in driving the Marketing Operations and Analytics team. He has a keen interest in data analysis, data, software architecture, and the creation of technical content related to the realm.

Visualize Your MySQL Data In Tableau Easily

Get Started with Hevo