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.
We've tested Data Studio on the following MySQL versions:
- Sign in to Data Studio.
- In the top left, click , then select Data Source.
- Select the MySQL connector
- Configure access to your database using one of the connection options (see below)
- Click AUTHENTICATE
- You will see a list of tables in that database
- Select a table
- Click CONNECT.
You can now access all of the columns in the table as fields in your reports.
Connecting with a hostname or IP address requires the following information:
- Hostname or IP address
Data Studio can't connect to localhost. You must use a public hostname or IP address.
- Port (Optional)
To connect via a JDBC URL, provide the following connection information:
- JDBC URL
jdbc:mysql://<hostname or IP address>[:<port>]/<database>
Use secure connection (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.
Learn more about MySQL secure connections.
Select a table
When you click authorize, Data Studio will try to access your database and list all of the tables. Finally you need to select one table and click connect.
Data Studio will then turn all of the columns in the table into fields.
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.
Special data types
Data Studio will map your table’s column data types to a unified set of Data Studio types. Some database types are currently not supported in Data Studio. When Data Studio encounters a column of a non-supported type, it will not create a field for that column.
Unsupported database types
Data Studio does not support MySQL's Spatial Data Extensions.
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 MySql database.
Limits of the MySQL connector
- You can query a maximum of 100K rows using this connector.
- Column headers (field names) must use ASCII characters only. Non-ASCII characters aren't supported.