Overview
Connecting MySQL to Pylar allows you to query and analyze your MySQL data directly from Pylar. Your data remains in MySQL—Pylar indexes it for easier querying and executes queries on your MySQL infrastructure.Prerequisites
- ✅ Pylar account with Analyst role or higher
- ✅ MySQL database access
- ✅ Database credentials (host, port, database name, username, password)
- ✅ Ability to whitelist IP addresses in MySQL firewall
Step 1: Navigate to Connections
- In your Pylar workspace, click on the “Connections” tab located in the sidebar
- You’ll see the list of available data sources
Step 2: Select MySQL
From the list of available data sources, select “MySQL”. The connection setup screen will open.Step 3: Enter Connection Details
You’ll need the following information to connect:Host
The hostname or IP address of your MySQL server. Examples:mysql.example.com192.168.1.100db.example.com
Port
The port number for MySQL. Default:3306
Note: If your MySQL server uses a non-standard port, enter that port number.
Database Name
The name of the database you want to connect to. Example:production, analytics, customer_data
Username
Your MySQL username that has access to the database. Best Practice: Create a dedicated user for Pylar with read-only permissions.Password
The corresponding password for your MySQL username.Use a dedicated MySQL user account for Pylar with read-only permissions when possible. This enhances security and allows for better access control.
Step 4: Whitelist Pylar IP Address
Critical Step: Whitelist Pylar’s IP address to ensure seamless connectivity. Pylar IP Address:34.122.205.142
How to whitelist:
Option 1: MySQL User Host Restrictions
- Connect to MySQL as administrator
- Create or modify user to allow connections from Pylar’s IP:
Option 2: Cloud Provider Firewall
If using a cloud-hosted MySQL (AWS RDS, Google Cloud SQL, Azure Database): AWS RDS:- Go to RDS Security Groups
- Add inbound rule: Allow MySQL (port 3306) from IP
34.122.205.142
- Go to Cloud SQL instance
- Add authorized network:
34.122.205.142/32
- Go to Azure Portal → Firewall settings
- Add client IP:
34.122.205.142
Option 3: Server Firewall
If hosting MySQL yourself:- Configure your server’s firewall (iptables, ufw, etc.)
- Allow port 3306 from IP
34.122.205.142
Whitelisting the IP address is crucial for establishing a secure and stable connection. Without it, Pylar will not be able to connect to your MySQL database, and you may encounter network or security blocks.
Step 5: Test Connection
- Click the “Submit” button
- Pylar will test the connection to your MySQL database
- If successful, you’ll see a success message
- If it fails, you’ll be prompted to make corrections to your database credentials
A successful connection test means Pylar can reach your MySQL server and authenticate. Verify all details are correct before proceeding.
Step 6: Save and Connect
Once the connection test is successful:- Click “Save” to save your configuration
- You’ll be prompted to give the connection a schema name
- Enter a descriptive name (e.g.,
mysql_productionoranalytics_db) - Save the configuration
- Lowercase letters only
- Numbers and underscores allowed
- No spaces or special characters
Using Your MySQL Connection
Query MySQL Data
Reference your connection by the schema name you provided:Join with Other Sources
Join MySQL data with other connected sources:Troubleshooting
Issue: Connection test fails
Solutions:- Verify host and port are correct
- Check username and password
- Ensure IP address
34.122.205.142is whitelisted - Verify database name exists
- Check MySQL is accessible from the internet
Issue: “Access denied” error
Solutions:- Verify username and password are correct
- Check user has permissions to access the database
- Ensure user host is configured correctly (allow
34.122.205.142) - Review MySQL user privileges
Issue: “Network or security block” error
Solutions:- Confirm IP address
34.122.205.142is whitelisted - Check firewall rules allow MySQL port (3306)
- Review network security group settings
- Verify MySQL
bind-addressallows remote connections
Issue: “Connection timeout” error
Solutions:- Verify MySQL server is running
- Check network connectivity
- Ensure firewall allows connections
- Verify port number is correct
Best Practices
User Account Security
- ✅ Create a dedicated MySQL user for Pylar
- ✅ Grant only SELECT permissions (read-only)
- ✅ Restrict user to specific databases
- ✅ Regularly audit user permissions
Network Security
- ✅ Whitelist only Pylar’s IP address
- ✅ Use SSL connections when possible
- ✅ Monitor connection logs
- ✅ Review failed connection attempts
Next Steps
Now that MySQL is connected:- Creating Data Views - Create views using MySQL data
- Cross-Database Joins - Join MySQL with other sources
- Connection Security - Secure your connections
Create Views
Use your MySQL connection to create data views