How to load data from IBM Db2 to MySQL Destination
Learn how to use Airbyte to synchronize your IBM Db2 data into MySQL Destination within minutes.


Building your pipeline or Using Airbyte
Airbyte is the only open source solution empowering data teams to meet all their growing custom business demands in the new AI era.
Building in-house pipelines
- Inconsistent and inaccurate data
- Laborious and expensive
- Brittle and inflexible
After Airbyte
- Reliable and accurate
- Extensible and scalable for all your needs
- Deployed and governed your way
Start syncing with Airbyte in 3 easy steps within 10 minutes



Take a virtual tour
Demo video of Airbyte Cloud
Demo video of AI Connector Builder
Setup Complexities simplified!
Simple & Easy to use Interface
Airbyte is built to get out of your way. Our clean, modern interface walks you through setup, so you can go from zero to sync in minutes—without deep technical expertise.
Guided Tour: Assisting you in building connections
Whether you’re setting up your first connection or managing complex syncs, Airbyte’s UI and documentation help you move with confidence. No guesswork. Just clarity.
Airbyte AI Assistant that will act as your sidekick in building your data pipelines in Minutes
Airbyte’s built-in assistant helps you choose sources, set destinations, and configure syncs quickly. It’s like having a data engineer on call—without the overhead.
What sets Airbyte Apart
Modern GenAI Workflows
Streamline AI workflows with Airbyte: load unstructured data into vector stores like Pinecone, Weaviate, and Milvus. Supports RAG transformations with LangChain chunking and embeddings from OpenAI, Cohere, etc., all in one operation.
Move Large Volumes, Fast
Quickly get up and running with a 5-minute setup that enables both incremental and full refreshes for databases of any size, seamlessly scaling to handle large data volumes. Our optimized architecture overcomes performance bottlenecks, ensuring efficient data synchronization even as your datasets grow from gigabytes to petabytes.
An Extensible Open-Source Standard
More than 1,000 developers contribute to Airbyte’s connectors, different interfaces (UI, API, Terraform Provider, Python Library), and integrations with the rest of the stack. Airbyte’s AI Connector Builder lets you edit or add new connectors in minutes.
Full Control & Security
Airbyte secures your data with cloud-hosted, self-hosted or hybrid deployment options. Single Sign-On (SSO) and Role-Based Access Control (RBAC) ensure only authorized users have access with the right permissions. Airbyte acts as a HIPAA conduit and supports compliance with CCPA, GDPR, and SOC2.
Fully Featured & Integrated
Airbyte automates schema evolution for seamless data flow, and utilizes efficient Change Data Capture (CDC) for real-time updates. Select only the columns you need, and leverage our dbt integration for powerful data transformations.
Enterprise Support with SLAs
Airbyte Self-Managed Enterprise comes with dedicated support and guaranteed service level agreements (SLAs), ensuring that your data movement infrastructure remains reliable and performant, and expert assistance is available when needed.
What our users say

Raman Singh
Predictable, straightforward pricing model that simplified budgeting and significantly reduced overall spend

Chase Zieman

“Airbyte helped us accelerate our progress by years, compared to our competitors. We don’t need to worry about connectors and focus on creating value for our users instead of building infrastructure. That’s priceless. The time and energy saved allows us to disrupt and grow faster.”

Rupak Patel
"With Airbyte, we could just push a few buttons, allow API access, and bring all the data into Google BigQuery. By blending all the different marketing data sources, we can gain valuable insights."
How to Sync to Manually
Step 1: Prepare the MySQL Database
1. Install MySQL: Ensure that MySQL is installed on the target system. If not, download and install it from the official MySQL website.
2. Create a Database: Log in to MySQL and create a new database where you will import the DB2 data.
```
CREATE DATABASE target_database;
```
3. Create Tables: Define the schema in MySQL that matches the DB2 source. Ensure that data types are compatible and consider differences between DB2 and MySQL data types.
```
USE target_database;
CREATE TABLE example_table (
column1 INT,
column2 VARCHAR(255),
...
);
```
Step 2: Export Data from IBM DB2
1. Connect to DB2: Use the DB2 command line tool to connect to your DB2 database.
```
db2 connect to source_database user myusername using mypassword
```
2. Export Data: Use the `EXPORT` command to export data from the DB2 tables to delimited text files or CSV files.
```
db2 "EXPORT TO '/path_to_exported_file/table_name.csv' OF DEL TYPE MODIFIED BY NOCHARDEL SELECT * FROM schema_name.table_name"
```
Repeat this step for each table you want to migrate.
Step 3: Data Conversion (if necessary)
1. Check Data Types: Review the exported data for any data types that may not be directly compatible with MySQL and convert them accordingly.
2. Date/Time Formats: Convert any date/time values to formats supported by MySQL.
3. Character Encoding: Ensure the character encoding in the exported files matches the encoding expected by MySQL (e.g., UTF-8).
Step 4: Import Data into MySQL
1. Prepare MySQL for Import: Log in to MySQL and select the target database.
```
mysql -u username -p
USE target_database;
```
2. Disable Constraints: Temporarily disable foreign key checks to avoid constraint violations during import.
```
SET FOREIGN_KEY_CHECKS=0;
```
3. Import Data: Use the `LOAD DATA INFILE` command to import the data from the CSV files into the corresponding MySQL tables.
```
LOAD DATA INFILE '/path_to_exported_file/table_name.csv'
INTO TABLE example_table
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES;
```
Adjust field terminators and line terminators according to the format of your exported files. Repeat this step for each table.
4. Re-enable Constraints: Once all data is imported, re-enable foreign key checks.
```
SET FOREIGN_KEY_CHECKS=1;
```
Step 5: Verify Data Integrity
1. Check Data Counts: Compare the row counts in MySQL tables with the original DB2 tables to ensure all data was imported.
```
SELECT COUNT(*) FROM example_table;
```
2. Check Data Quality: Perform queries on both databases to compare random sets of data and ensure they match.
Step 6: Finalize the Migration
1. Indexing: Create any necessary indexes on the MySQL tables to optimize performance.
2. Optimization: Run `ANALYZE TABLE` on the imported tables to update table statistics for better performance.
```
ANALYZE TABLE example_table;
```
3. Backup: Take a backup of the MySQL database after the migration to ensure you have a recovery point.
Step 7: Post-Migration Tasks
1. Update Applications: Change the database connection settings in any applications that need to connect to the new MySQL database.
2. Test: Thoroughly test your applications to ensure they function correctly with the new MySQL database.
3. Monitoring: Monitor the MySQL database for performance and stability issues.
Additional Notes
- The above commands are examples and may need to be adjusted based on your specific environment, table names, schema, data types, and file paths.
- Always perform a migration on a test environment before applying it to production.
- Make sure to have backups of both the DB2 and MySQL databases in case you need to roll back.
- Review MySQL's documentation for any version-specific features or limitations.
By following these steps, you should be able to migrate your data from IBM DB2 to MySQL without using third-party connectors or integrations. Remember to proceed with caution and test thoroughly at each step.