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

There are various ways you can automate the import of MySQL data into Google Sheets, and each has its own pros and cons. Some are free but need a great deal of time and expertise; others are easy to use but are pricey. So the best method may depend on your needs.

A good way to automate the import of MySQL data to Google Sheets is to use a data automation tool such as Amigo Data that lets you easily retrieve data from various databases and automate the process.

Yes, you can import a specific table from MySQL to Google Sheets. Just select the “Import from tables” option and you’ll be presented with the list of tables from the MySQL database. Click the table to import to the table from MySQL database to Google Sheets.

You can also import data from MySQL to Google Sheets using custom SQL queries. With this option, you can retrieve specific data from a particular table or multiple tables.

Scheduling automatic imports of MySQL data into Google Sheets can easily be done with Amigo. Simply set the refresh schedule and specify the time and period of the automatic imports. And Amigo will automatically import the data at the specified time.

Yes. To import data from multiple MySQL databases into a single Google Sheets workbook, connect the databases separately to import data from the MySQL databases. Then import the data from MySQL to Google Sheets.

When you import the data from MySQL to Google Sheets, you’ll be given the option to import the data to a new sheet or an existing sheet. Select the existing into which you want to import the data.

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

X
Hire expert data analysts on-demand. Get 30 Days Free Trial