How to Use the SQL Connector

How to Use the SQL Connector


Power My Analytics now offers an SQL connector in addition to our Hosted SQL solution. This article will help you get started with using our SQL connector and set up a MSSQL or MySQL query.


Connect to your server in the Hub

Select Sources in the left navigation pane, then click + New Data Source. Click on SQL in the gallery.



Choose MySQL or MSSQL, then enter your Host, Port, Username, Password, and a Name for this server.



Make sure your SQL server is configured to allow connections from PMA's IP address, 35.188.118.242.


Create a query

The connector configuration screen for SQL requires you to enter a query manually.



Format your query according to your database's rules.
A successful query may look like this:

12345
SELECT
*
FROM
table
WHERE DATE BETWEEN
$start$
AND
$end$
limit 100

  1. Use * if you want to retrieve all data from your table. Otherwise, enter the specific terms you wish to select for and make sure the spelling is exactly the same.
  2. Enter the name of the table here and make sure the spelling is exactly the same. Use underline characters (_) instead of spaces.
  3. Date should be formatted according to your database's rules or you can use $start$ to specify your start date within the report.
  4. Date should be formatted according to your database's rules or you can use $end$ to specify your end date within the report.
  5. Set a limit on the number of rows you wish to retrieve. Larger limits will take longer to retrieve. Looker Studio has a limit of 1,000,000. If you do not set a limit and you retrieve more than 1,000,000, you will receive an error.
Click Connect to create your report. If you entered $start$ and $end$ instead of dates, you may specify your range by adding a date range control in Data Studio.



    • Related Articles

    • Power My Analytics' Sovereign SQL Warehouse Solution

      Power My Analytics offers a Sovereign SQL Warehouse solution with your Enterprise plan. This article will help you learn about its uses and how to get started. With our hosted MySQL sovereign warehouse solution, you can achieve GDPR compliance by ...
    • How to Export to Azure SQL Database

      Exporting your marketing data to Azure SQL allows you to integrate it with various applications and run complex data queries. This guide will walk you through the process of setting up and managing your Azure SQL exports using Power My Analytics. An ...
    • Community Connector Error: The data source API took longer than the 60 second Google Sheets or Looker Studio timeout.

      This article will address the following error: "The Google Sheets or Looker Studio timeout was reached before the data source API responded. Reducing the date range may help avoid timeouts. For higher limits, contact us about enterprise solutions." ...
    • How to Export to MySQL

      Our MySQL export feature enables flexible access to your data in the form of tables in a MySQL database hosted on the server of your choice. Once you've prepared a report in Data Explorer, you're ready to export your data to your MySQL server. With ...
    • How to Export to PostgreSQL

      Our PostgreSQL export feature enables flexible access to your data in the form of tables in a PostgreSQL database hosted on the server of your choice. Once you've prepared a report in Data Explorer, you're ready to export your data to your PostgreSQL ...