How to Export MySQL to Excel: Step-by-Step Guide


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.
- Inconsistent and inaccurate data
- Laborious and expensive
- Brittle and inflexible
- 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
What sets Airbyte Apart
Modern GenAI Workflows
Move Large Volumes, Fast
An Extensible Open-Source Standard
Full Control & Security
Fully Featured & Integrated
Enterprise Support with SLAs
What our users say


"The intake layer of Datadog’s self-serve analytics platform is largely built on Airbyte.Airbyte’s ease of use and extensibility allowed any team in the company to push their data into the platform - without assistance from the data team!"


“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.”


“We chose Airbyte for its ease of use, its pricing scalability and its absence of vendor lock-in. Having a lean team makes them our top criteria. The value of being able to scale and execute at a high level by maximizing resources is immense”
- Open MySQL command-line client or MySQL Workbench.
- Log in to your MySQL server using your credentials.
Use the command: `USE database_name;`
Prepare the SQL query to select the data you want to export.
Example: `SELECT * FROM table_name;`
Use the MySQL `INTO OUTFILE` clause to export the query results to a CSV file.
Example:
```sql
SELECT * FROM table_name
INTO OUTFILE '/path/to/export/file.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
```
Note: Ensure that the MySQL user has FILE privileges and the specified directory is writable.
Find the CSV file in the specified directory on your server.
If the MySQL server is on a remote machine, use FTP, SCP, or any file transfer method to download the CSV file to your local machine.
Launch Excel on your local machine.
- Click on "Data" in the top menu.
- Select "From Text/CSV" option.
- Browse and select the exported CSV file.
- In the import wizard, ensure the delimiter is set to comma (,) and file origin is set to UTF-8.
- Click "Load" to import the data into Excel.
- Adjust column widths, apply formatting, or create charts as needed.
- Save the file in Excel format (.xlsx or .xls).
Alternative Method (for smaller datasets):
If you're dealing with a smaller dataset, you can use the following method:
1. Follow steps 1-3 from above.
2. Execute the query in MySQL client or Workbench.
3. Select all the results in the output pane.
4. Copy the selected data (Ctrl+C or right-click and select Copy).
5. Open Microsoft Excel.
6. Paste the data into Excel (Ctrl+V or right-click and select Paste).
7. Use Excel's "Text to Columns" feature if the data is not properly separated into columns:
- Select the pasted data.
- Go to "Data" > "Text to Columns".
- Choose "Delimited" and select the appropriate delimiter (usually Tab).
- Click "Finish" to separate the data into columns.
8. Format and save the Excel file as needed.
This method is quicker for smaller datasets but may not be practical for large amounts of data.
Remember that these methods do not maintain any database constraints or relationships. They simply export the raw data as it appears in the query results.
FAQs
What is ETL?
ETL, an acronym for Extract, Transform, Load, is a vital data integration process. It involves extracting data from diverse sources, transforming it into a usable format, and loading it into a database, data warehouse or data lake. This process enables meaningful data analysis, enhancing business intelligence.
MySQL is an SQL (Structured Query Language)-based open-source database management system. An application with many uses, it offers a variety of products, from free MySQL downloads of the most recent iteration to support packages with full service support at the enterprise level. The MySQL server, while most often used as a web database, also supports e-commerce and data warehousing applications and more.
MySQL provides access to a wide range of data types, including:
1. Numeric data types: These include integers, decimals, and floating-point numbers.
2. String data types: These include character strings, binary strings, and text strings.
3. Date and time data types: These include date, time, datetime, and timestamp.
4. Boolean data types: These include true/false or yes/no values.
5. Spatial data types: These include points, lines, polygons, and other geometric shapes.
6. Large object data types: These include binary large objects (BLOBs) and character large objects (CLOBs).
7. Collection data types: These include arrays, sets, and maps.
8. User-defined data types: These are custom data types created by the user.
Overall, MySQL's API provides access to a wide range of data types, making it a versatile tool for managing and manipulating data in a variety of applications.
What is ELT?
ELT, standing for Extract, Load, Transform, is a modern take on the traditional ETL data integration process. In ELT, data is first extracted from various sources, loaded directly into a data warehouse, and then transformed. This approach enhances data processing speed, analytical flexibility and autonomy.
Difference between ETL and ELT?
ETL and ELT are critical data integration strategies with key differences. ETL (Extract, Transform, Load) transforms data before loading, ideal for structured data. In contrast, ELT (Extract, Load, Transform) loads data before transformation, perfect for processing large, diverse data sets in modern data warehouses. ELT is becoming the new standard as it offers a lot more flexibility and autonomy to data analysts.
What should you do next?
Hope you enjoyed the reading. Here are the 3 ways we can help you in your data journey: