How to Connect MySQL to Google Sheets

Reading Time: 6 minutes

Looking for a quick and easy way to connect MySQL to Google Sheets and import data from MySQL database to Google Sheets? Look no further; we’ve got you covered.

In this article, we’re going to learn how to connect MySQL to Google Sheets in a couple of minutes (normally less) and pull MySQL data to Google Sheets with no coding. You can import data from MySQL database to Google Sheets with a couple of clicks after setting up a MySQL and Google Sheets connection–which itself takes only a few seconds.

If you want a bit of complexity and flexibility for advanced data retrieval from MySQL to Google Sheets, you shall have that, too. You can import not only from a data table but also using your own SQL query and import data from multiple tables with specific conditions.

Oh, yeah, this is done with a tool called Amigo. Amigo is a web application that you can use to connect Google Sheets with databases such as Snowflake, ClickHouse, BigQuery, PostgreSQL, and, of course, MySQL; and other data sources such as Facebook Ads, Shopify, Salesforce, and Google Analytics–to name (quite) a few. And after connecting, you can pull data to Google Sheets with ease and automate the process, and run SQL queries from Google Sheets to retrieve data from databases.

Okay. But enough about beating around the bush. Let us beat through.

But first, the steps.

Here are the steps to create a MySQL Google Sheets integration and import data from MySQL database to Google Sheets.

  1. Connect MySQL to Google Sheets
  2. Import MySQL data to Google Sheets

How to connect MySQL to Google Sheets and import data from MySQL to Google Sheets

Here are the steps to connect MySQL to Google Sheets and automatically pull data from MySQL to Google Sheets.

Connect MySQL to Google Sheets

Log in to Amigo with your Google account or with any email address. (No prior signing is up required.)

Sign in to Amigo to connect MySQL to Google Sheets

Click “Create new connections” to set up a MySQL Google Sheets connection.

Setting up a new MySQL Google Sheets connection

Select MySQL from the source options to connect MySQL to Google Sheets.

Select MySQL to connect MySQL to Google Sheets

Enter the MySQL database details and click Connect to connect MySQL to Google Sheets.

Enter the MySQL details to connect MySQL to Google Sheets

On clicking “Connect”, the MySQL database will be connected to Google Sheets. The created MySQL-Google Sheets connection will show up on the connections dashboard.

The created MySQL Google Sheets connection

And so this completes the MySQL and Google Sheets integration. We can now proceed to import MySQL data to Google Sheets.

Import data from MySQL to Google Sheets

As mentioned, there are two ways you can import data from MySQL to Google Sheets, each suited for different needs. The codeless method if you want to quickly retrieve data from MySQL to Google Sheets and dump the whole tables without much filtration. And the SQL query method if you need to filter the data or pull data from multiple tables using your own SQL query.

We’ll start with the non-code method.

Method 1: Import data from MySQL to Google Sheets without code

Click the connection you’ve created.

Click the MySQL Google Sheets integration to import data from MySQL to Google Sheets

Choose whether to import from table or using SQL query. Click “Import from Tables”.

Option to import MySQL data to Google Sheets

On clicking the tables option, you’ll be presented will all the data tables of the MySQL database that you have connected to Google Sheets.

Select the table to import from. For the sake of this tutorial, we’ll chose “dept_emp”. On clicking a data table, the data therein will be displayed as preview. To go back and select another table, click the table name (in this case, “dept_emp”) underneath “Table”.

Available MySQL data tables - Connect MySQL to Google Sheets

By default all metrics are selected. Unselect the metrics to omit; or simply uncheck the “Select all” option and select the metrics you want to import from MySQL to Google Sheets.

Metrics of the data - Connect Google Sheets to MySQL

Then set the row limit. The row limit is set to 50 by default. Name the report. And then click “Import to Google Sheets”.

Import MySQL to Google Sheets - Connect MySQL to Google Sheets

If you’re using Amigo for the first time you need to connect Amigo to Google Drive to export the data to Google Sheets (you can also connect to multiple accounts). Add a connection to export the data from MySQL to Google Sheets by clicking the “Export” button.

Method 2: Export data from MySQL to Google Sheets using SQL query

On clicking the MySQL Google Sheets connection you’ve created, you’ll be presented with an option whether to import from tables or with custom SQL query. If you don’t see the SQL query option, click this link and select the connection.

Import data from MySQL to Google Sheet with SQL query - MySQL Google Sheets integration

Clicking the SQL query option takes you to a page where you can enter the SQL query to extract data from MySQL database to Google Sheets.

SQL query - Connect MySQL to Google Sheets

Enter the SQL query and click “Run” to preview the data. Then click “Import to Google Sheets” to import the data from MySQL to Google Sheets.

Preview of the data from MySQL to export to Google Sheets

You can export the data to the Google account that you have connected previously or add a new account to connect Google Sheets to MySQL.

Bonus:

Automate data imports from MySQL to Google Sheets

Amigo can sync MySQL with Google Sheets and automatically update the exported data regularly–hourly, daily, weekly, or on certain days of the week. This option is not yet available on the web version however. So you’ll have to use the Amigo add-on in Google Sheets if you want to avail this feature. You can get it from the Google Workspace Marketplace. Click this link to get the add-on.

Get alerts of the data exported from MySQL to Google Sheets

If you want to get the imported data sent to your email or Slack, you can set up an alert and add the email addresses of all the people you want to share the data with and the Slack channels to which you want the alert to be sent. Then Amigo will update you and your team with the latest data. This feature is also, for now, only available with the add-on, for now.

And haven’t I mentioned that you can integrate various sources with Google Sheets using Amigo? You can find all of them and many others on our website. To learn how to create connections and extract data from them, visit our blog.


Some related questions

What is the best way to automate the import of MySQL data into Google Sheets?

Can I import a specific table or query from MySQL to Google Sheets?

Can I schedule automatic imports of MySQL data into Google Sheets?

Can I import data from multiple MySQL databases into a single Google Sheet?

Some articles you may find useful:

How to connect Shopify to Google Sheets

Connect HubSpot To Google Sheets

Export Google Analytics Data to Google Sheets

Leave a Reply

Discover more from Amigo: No-code Data Integrations to Google Sheets

Subscribe now to keep reading and get access to the full archive.

Continue reading