Skip to main content

MySQL (Source) Connector

Prerequisites

  • A MySQL database (5.7+ or 8.0+)
  • A user with SELECT privileges on the tables you want to sync
  • Network connectivity from Landed to your MySQL server

Getting Your Credentials

Connect to your MySQL server and create a dedicated user for Landed:

CREATE USER 'landed_reader'@'%' IDENTIFIED BY 'your-secure-password';
GRANT SELECT ON mydb.* TO 'landed_reader'@'%';
FLUSH PRIVILEGES;

Replace mydb with your database name, or grant access to specific tables:

GRANT SELECT ON mydb.orders TO 'landed_reader'@'%';
GRANT SELECT ON mydb.customers TO 'landed_reader'@'%';

Step 2: Allow Network Access

Ensure your MySQL server accepts connections from Landed's IP addresses. You may need to:

  1. Cloud-hosted databases (RDS, Cloud SQL, Azure): Add Landed's static IPs to the security group or authorized networks
  2. Self-hosted databases: Update your firewall rules to allow inbound connections on your MySQL port
  3. VPN/Private network: Set up a VPN tunnel or SSH bastion (contact Landed support)

Configuration in Landed

FieldValue
HostHostname or IP of your MySQL server (e.g., db.example.com)
PortMySQL port (default: 3306)
DatabaseDatabase name to connect to
UsernameMySQL username (e.g., landed_reader)
PasswordPassword for the MySQL user
Tables to sync (optional)Specific tables to sync (e.g., mydb.orders). Leave empty to discover all accessible tables.

Available Streams

The MySQL connector dynamically discovers all tables the configured user can access. Each table becomes a stream.

Sync modes:

  • Tables with a cursor field (e.g., updated_at, modified_at) sync incrementally
  • Tables without a cursor field sync via full refresh

You can configure per-table cursor fields in the connector settings to enable incremental sync for specific tables.

Common Issues

SymptomCauseFix
Can't connect to MySQL serverNetwork connectivity issueVerify the host, port, and firewall rules. Add Landed's IPs to your security group.
Access denied for userWrong credentialsVerify username and password
SELECT command deniedUser lacks SELECT privilegeRun GRANT SELECT ON mydb.* TO 'landed_reader'@'%';
Missing tablesUser lacks access to specific tablesGrant SELECT on the specific tables
Unknown databaseDatabase name incorrectVerify the database name exists on the server
Slow syncLarge tables without cursor fieldConfigure a cursor field (e.g., updated_at) for incremental sync

Static IPs for Allowlisting

Add these IPs to your database security group or firewall:

  • Production: 34.170.185.84, 35.192.90.94
  • Staging: 34.171.93.34

Security Recommendations

  • Use a dedicated read-only user with minimal privileges
  • Enable SSL/TLS for the database connection when possible
  • Restrict the user to SELECT on only the tables you need synced
  • Use strong passwords and rotate them periodically