MySQL
Connect to MySQL databases for analytics
MySQL is one of the world's most popular open-source relational databases, widely used for web applications and enterprise systems. Scoop connects directly to MySQL, enabling AI-powered analysis on your data.
Connection Details
| Setting | Value |
|---|---|
| Default Port | 3306 |
| Connection Type | TCP/IP |
| SSL | Recommended |
Prerequisites
Before connecting Scoop to MySQL:
- MySQL server (version 5.7 or later recommended)
- Read-only user with SELECT permissions
- Network access from Scoop's IP addresses
Create a Read-Only User
Connect to your MySQL database and run:
-- Create the read-only user (accessible from any host)
CREATE USER 'scoop_user'@'%' IDENTIFIED BY 'your_secure_password';
-- Grant SELECT on your database
GRANT SELECT ON your_database.* TO 'scoop_user'@'%';
-- Apply the changes
FLUSH PRIVILEGES;Replace your_database and the password with your actual values.
For enhanced security, you can restrict to specific IP addresses:
CREATE USER 'scoop_user'@'SCOOP_IP' IDENTIFIED BY 'your_secure_password';
GRANT SELECT ON your_database.* TO 'scoop_user'@'SCOOP_IP';
FLUSH PRIVILEGES;Whitelist Scoop IP Addresses
For Cloud-Hosted MySQL
Amazon RDS:
- Go to your RDS instance's Security Group
- Edit inbound rules
- Add a rule allowing MySQL (port 3306) from Scoop's IP addresses
Google Cloud SQL:
- Go to your Cloud SQL instance
- Click Connections > Networking
- Add Scoop's IP addresses to Authorized Networks
Azure Database for MySQL:
- Go to your server's Connection Security
- Add firewall rules for Scoop's IP addresses
For Self-Hosted MySQL
Configure your firewall to allow incoming connections on port 3306 from Scoop's IP addresses. Also ensure MySQL is configured to accept remote connections in my.cnf:
bind-address = 0.0.0.0Contact Scoop support for the current list of IP addresses to whitelist.
Connect in Scoop
- Navigate to Datasets and click New Dataset
- Select Database as your source
- Choose MySQL from the database type dropdown
- Enter your connection details:
- Server Host: Your database hostname or IP
- Port: 3306 (or your custom port)
- Database: Your database name
- Username: scoop_user
- Password: The user's password
- Click Test Connection to verify
- Enter your SQL query and proceed
Connection URL Format
If using a JDBC URL directly:
jdbc:mysql://hostname:3306/database_name
With SSL:
jdbc:mysql://hostname:3306/database_name?useSSL=true&requireSSL=true
Best Practices
- Enable SSL for encrypted connections
- Use InnoDB storage engine for better performance and reliability
- Create indexes on frequently filtered columns
- Use EXPLAIN to analyze and optimize slow queries
Troubleshooting
Connection Refused
- Verify MySQL is configured to accept remote connections
- Check that the user can connect from your IP:
SELECT user, host FROM mysql.user; - Ensure port 3306 is open in your firewall
Access Denied
- Verify the username and password are correct
- Check the user's host permissions allow connection from Scoop's IP
- Verify GRANT statements were executed and FLUSH PRIVILEGES was run
Unknown Database
- Verify the database name is spelled correctly (MySQL is case-sensitive on some systems)
- Check the user has access to the database:
SHOW GRANTS FOR 'scoop_user'@'%';
Updated about 5 hours ago