MySQL Integration
Overview
MySQL is one of the world's most popular open-source relational database management systems. The MySQL integration package provides direct database access for reading and writing data, enabling seamless data synchronization between MySQL databases and other systems in your integration workflows.
This integration uses the mysql2 Node.js library to provide fast, efficient connections to MySQL databases with support for connection pooling, prepared statements, and advanced query features.
Key Features
📊 Direct Database Access
Execute SQL queries directly against your MySQL database for maximum flexibility
🔍 Flexible Querying
Support for custom WHERE clauses, ORDER BY, GROUP BY, and LIMIT for precise data retrieval
📥 Bulk Operations
Efficient batch inserts and updates with configurable chunk sizes
🔄 Upsert Logic
Smart insert/update operations using primary keys to handle existing records
⚡ Performance Optimized
Connection pooling and chunked processing for handling large datasets
🔐 Secure Connections
Support for SSL/TLS and additional connection parameters for secure database access
When to Use This Integration
- Pull data from MySQL to sync with e-commerce platforms, CRMs, or data warehouses
- Insert records from external systems into MySQL databases
- Sync inventory between MySQL-based systems and e-commerce platforms
- Export data from MySQL for reporting, analytics, or backup purposes
- Update records in MySQL based on events from other systems
- Migrate data between MySQL databases or to other database systems
Configuration
Required Fields
Configure the MySQL integration with database connection parameters:
{
"connection_parameters": {
"host": "localhost",
"port": 3306,
"database": "ecommerce_db",
"user": "db_user",
"password": "secure_password",
"additionalParameters": {
"timezone": "UTC",
"charset": "utf8mb4"
}
}
}host
Type: String (required)
Description: MySQL server hostname or IP address
Example: localhost, mysql.example.com, 10.0.0.5
port
Type: Integer (required)
Description: MySQL server port number
Default: 3306
database
Type: String (required)
Description: Name of the database to connect to
Example: ecommerce_db
user
Type: String (required)
Description: Database username for authentication
Example: db_user
password
Type: String (required)
Description: Database password for authentication
Security Note: Store securely in Retrieve configuration
additionalParameters
Type: Object (optional)
Description: Additional MySQL connection options (SSL, timezone, charset, etc.)
Example: {"ssl": true, "timezone": "UTC", "charset": "utf8mb4"}
Database User Permissions
Use Cases
🔄 Database Synchronization
Keep MySQL databases in sync with e-commerce platforms, CRMs, or other data sources.
📊 Data Export
Extract data from MySQL for reporting, analytics, or data warehousing purposes.
📥 Data Import
Load data from external systems into MySQL tables for processing or storage.
🔁 ETL Pipelines
Build complex ETL workflows with MySQL as source or destination.
🏪 Inventory Management
Sync inventory levels between MySQL databases and e-commerce platforms.
👥 Customer Data Sync
Synchronize customer information between MySQL and external CRM or marketing systems.
Connection Security
Secure Connection Options
For production environments, always use secure connections:
{
"connection_parameters": {
"host": "mysql.example.com",
"port": 3306,
"database": "ecommerce_db",
"user": "db_user",
"password": "secure_password",
"additionalParameters": {
"ssl": true
}
}
}Security Best Practices
- ✅ Use dedicated database users with minimal required permissions
- ✅ Enable SSL/TLS for database connections
- ✅ Store credentials securely in Retrieve configuration
- ✅ Use read-only users for pull operations when possible
- ✅ Restrict database access by IP address or VPN
- ✅ Regularly rotate database passwords
- ✅ Monitor database access logs for suspicious activity
Performance Considerations
⚡ Optimize Query Performance
- Use appropriate indexes on columns in WHERE clauses
- Limit result sets with
query_limitfor large tables - Use
query_fieldsto select only needed columns - Add appropriate
chunk_waiting_timeto avoid overwhelming the database
🔧 Connection Pooling
The integration uses connection pooling by default. Configure additionalParameters for custom pool settings:
{
"additionalParameters": {
"connectionLimit": 10,
"queueLimit": 0,
"waitForConnections": true
}
}Troubleshooting
🔴 Issue: "Access denied" error
Cause: Incorrect username, password, or insufficient permissions.
Solution: Verify credentials and ensure user has required permissions. Check that user is allowed from the connection host.
🔴 Issue: "Can't connect to MySQL server"
Cause: Network connectivity issue or incorrect host/port.
Solution: Verify network connectivity, firewall rules, and that MySQL is running on specified host:port.
🔴 Issue: "Unknown database" error
Cause: Database name doesn't exist or typo in database name.
Solution: Verify database name exists and is spelled correctly (case-sensitive on some systems).
🔴 Issue: Slow query performance
Cause: Missing indexes or fetching too much data at once.
Solution: Add indexes to filtered columns, reduce chunk size, or add more specific query filters.
Support & Resources
For help with MySQL integration:
- Check the MySQL Documentation
- Review mysql2 library documentation
- Contact Retrieve support for integration-specific questions