Connect to MySQL

Connect Data Studio to MySQL databases.

The MySQL connector allows you to access data from MySQL databases within Data Studio.

In this article:

How to connect to MySQL

A Data Studio data source can connect to a single MySQL database table.

The Data Studio MySQL connector is based on Google Cloud SQL for MySQL, and is subject to the same limits on versions and supported features. Learn more about Google Cloud SQL for MySQL.

Supported versions

We've tested Data Studio on the following MySQL versions:

  • 5.6
  • 5.7
  • 8.0

If you experience issues using a supported version, please let us know in the Data Studio Help Community. You can add and vote on feature requests here.

To connect

  1. Sign in to Data Studio.
  2. In the top left, click Create then select Data Source.
  3. Select the MySQL connector
  4. Set up the connection to your database:

    Connect with a hostname or IP address,

    1. On the left, select BASIC.
    2. Enter the connection details:
      1. Hostname or IP address
      2. Port (Optional)
      3. Database
      4. Username
      5. Password

    Connect with a JDBC URL

    1. On the left, select JDBC URL.
    2. Enter the connection details:
      1. JDBC URL

        Example

        jdbc:mysql://<hostname or IP address>[:<port>]/<database>

      2. Username
      3. Password
    If you use the JDBC hostname option, you can make sure it's accessible with public DNS lookup tools such as Whois.
    Note: Data Studio can't connect to localhost. You must use a public hostname or IP address.
  5. Enable SSL (optional)

    Data Studio supports secure (encrypted) connections to the server using the TLS (Transport Layer Security) protocol. TLS is also referred to as SSL (Secure Sockets Layer). To enable a secure connection, check Enable SSL, then provide your SSL client configuration files.

  6. Click AUTHENTICATE.
  7. Select a table from the list or enter a custom query.
    Select the CUSTOM QUERY option to provide a SQL query instead of connecting to a single table. Data Studio uses this custom SQL as an inner select statement for each generated query to the database.
  8. Click CONNECT.

In a moment, the data source fields list page appears. In the upper right, click CREATE REPORT or EXPLORE to start visualizing your data.

Notes

Data types

Data Studio maps your database's native data types to a unified set of data types. If Data Studio encounters a column in your table or query of an unsupported type, it will not create a field for that column.

Note: Data Studio does not support MySQL's Spatial Data Extensions.

Firewall access

If your database is behind a firewall, you will need to open access to all of the following IP addresses. These are used by Data Studio to connect to and query your database.

Show the list of IP addresses

64.18.0.0/20

64.233.160.0/19

66.102.0.0/20

66.249.80.0/20

72.14.192.0/18

74.125.0.0/16

108.177.8.0/21

142.251.74.0/23

173.194.0.0/16

207.126.144.0/20

209.85.128.0/17

216.58.192.0/19

216.239.32.0/19

2001:4860:4807::/48

Limits of the MySQL connector

  • You can query a maximum of 150K rows using this connector.
  • Column headers (field names) must use ASCII characters only. Non-ASCII characters aren't supported.

Create a data source

Was this helpful?
How can we improve it?
true
What's new in Data Studio

Learn about new features and recent changes.

Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
102097
false