MySQL Integration logo

MySQL Integration

Connect your MySQL database to Datapad and query your data using natural language instead of SQL.

Database5 min setupSSL Encrypted

Prerequisites

  • MySQL Database - A running MySQL instance (version 5.7 or higher) with your data
  • Database Credentials - Host, port, database name, username, and password with read access
  • Network Access - Database should be accessible from the internet or through VPN/SSH tunnel
  • SSL Certificate - SSL encryption for secure data transmission
  • Connection Methods

    Choose the connection method that best fits your security requirements and infrastructure setup.

    Database Connection Form

    Connect directly using your database credentials with SSL encryption.

    Connection String

    Use a MySQL connection string with SSL encryption.

    SSH Tunnel

    Connect through an SSH tunnel for maximum security.

    Connection Guide

    Step 1: Access MySQL Integration

    Navigate to Integrations in Datapad and select MySQL:

    MySQL connect screen on Datapad UI

    Step 2: Fill Connection String

    Enter your MySQL database connection string:

    MySQL connection string form in Datapad

    Required Fields:

    • Connection Name
    • Connection String
    • Database Schema
    The MySQL connection string format is: mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE_NAME

    Step 3: Fill Connection Details

    Enter your MySQL database connection details:

    MySQL connection form in Datapad

    Required Fields:

    • Database Host
    • Port (default: 3306)
    • Database Name
    • Username
    • Password
    • SSL Mode

    Create Read-Only User (Recommended)

    For security, create a dedicated user with read-only permissions:

    -- Create a new user for Datapad
    CREATE USER 'datapad_readonly'@'%' IDENTIFIED BY 'secure_password';
    
    -- Grant connect permission to the database
    GRANT USAGE ON *.* TO 'datapad_readonly'@'%';
    
    -- Grant select permissions on specific database
    GRANT SELECT ON your_database.* TO 'datapad_readonly'@'%';
    
    -- Apply the changes
    FLUSH PRIVILEGES;
    
  • Replace your_database with your actual database name and choose a strong password for the datapad_readonly user.
  • Example Queries

    Here are some example questions you can ask once your MySQL data is connected:

    "Show me the top 10 customers by revenue this month"
    "What's the average order value by customer segment?"
    "How many new users signed up each day this week?"
    "Which products have the highest profit margin?"
    "Show me monthly revenue growth for the last year"
    "What's our customer retention rate by cohort?"

    💬 Natural Language Tips

  • Be specific about time periods ("last 30 days", "this month vs last month")
  • Include table names when possible ("orders table", "users table")
  • Ask for comparisons to get more insights ("compare X vs Y")
  • Use business terms that align with your data schema
  • Behind the Scenes

    Datapad automatically converts your natural language questions into optimized SQL queries. You can always view the generated SQL to learn and verify the results.

    Troubleshooting

    Connection timeout

    If the connection times out:

    • Check firewall settings and whitelist Datapad IPs
    • Verify the host and port are correct
    • Ensure MySQL is accepting connections
    • Test connectivity from your network

    Authentication failed

    If authentication fails:

    • Verify username and password are correct
    • Check if the user has access to the database
    • Ensure user can connect from external hosts ('%' wildcard)
    • Try connecting with the same credentials using mysql client

    SSL connection issues

    If SSL connection fails:

    • Verify SSL is enabled on your MySQL server
    • Check if you have valid SSL certificates
    • Try different SSL modes (REQUIRED, PREFERRED, DISABLED)
    • Contact support for help with certificate issues
    Need Help?
    Our team is here to help you set up your integrations successfully