How to connect and read data from MySQL.
-
I want to read data from the MySQL database. I want to know the steps to how I can do that using Templator.
-
Templater can read from a variety of different data sources, so the specifics will depend on how exactly you want your system to be set up.
Locally, Templater can read from JSON and TSV files, so the most straightforward method to read MySQL data would be to export the desired data sets to a properly formatted JSON or TSV and then direct Templater to the appropriate source file.
Reading from an online data source will be a bit more complex. Templater can’t read from MySQL directly, so you’ll need to get the data into a format Templater can understand. For online data sources, Templater can read from Dataclay QUE, Google Sheets, or a JSON URL feed.
For the first two sources, you’d need to find a way to transfer data from the MySQL source to QUE or Google Sheets. Both QUE and Google Sheets have custom API hooks that could be used for this purpose, but you might also consider a third-party solution like Zapier.
If a more direct connection is desired, you could also use a JSON URL feed. It appears that there are multiple solutions for handling this in MySQL, but as long as the data is being returned with a REST API with endpoints, it should be readable by Templater. You can find more information about setting up a URL feed on this support page.
Hopefully, that’s enough information to get things started, but please feel free to let us know if you have any other questions.
Thanks!
-
@jeff Thank you so much Jeff it helps a lot.