0aslam0
0aslam0

Reputation: 1961

How to sync data between a Google Sheet and a Mysql DB?

So I have a Google sheet that maintains a lot of data. I also have a MySQL DB with a huge junk of data. There is a vital piece of information in the Sheet that is also present in the DB. Both needs to be in sync. The information always enters the Sheet first. I had a python script with mysql queries to update my database separately.

Now the work flow has changed. Data will enter the sheet and whenever that happens the database has to updated automatically.

Approach 1:

Have a python web-app running live. Send the data via UrlFetchApp.This I yet have to try.

Approach 2:

Connect to mySQL remotely through appscript. But I am not sure this is possible after 2-3 hours of reading the docs.

So this is my scenario. Any viable solution you can think of or a better approach?

Upvotes: 2

Views: 13292

Answers (2)

Using JDBC within Apps Script will work if you have the time to build this yourself.

If you don't want to roll your own solution, check out SeekWell. It allows you to connect to databases and write SQL queries directly in Sheets. You can create a run a “Run Sheet” that will run multiple queries at once and schedule those queries to be run without you even opening the Sheet.

Disclaimer: I made this.

Upvotes: 0

Zig Mandel
Zig Mandel

Reputation: 19834

Connect directly to mySQL. You likely missed reading this part https://developers.google.com/apps-script/guides/jdbc

Upvotes: 1

Related Questions