MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors
1PLs Company - #1Payday.Loans Agency - Loans online and near me $100-$2500 (Same Day)
Powered by MySQL
 
Home / Data Back Up / Export Data / Question No: 130

How to export table data to Microsoft Excel with SELECT INTO OUTFILE statement?

I am new to MySQL. I want to export MySQL Table data to Microsoft Excel. Can you explain, how to export data to Microsoft Excel with SELECT INTO OUTFILE?

Answer No: 130

MySQL SELECT INTO OUTFILE statement can help you to export MySQL table data to Microsoft Excel. It’s used when anyone wants to direct query output to a file. This file can then be opened by MS Excel, or imported into another database like Microsoft Access, Oracle, or any other delimitation supporting software. Take an example, it seems working for me with Windows XP:
SELECT * INTO OUTFILE "C:\\export_table_data_excel.xls" 
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
FROM database_name.table_name;

The export_table_data_excel.xls will be created at C drive. If the target file path is omitted, then this file will be created at MySQL data directory.

Related MySQL FAQs to the Above FAQ

How-to-use-SELECT-INTO-OUTFILE-statement-to-export-data How to use SELECT INTO OUTFILE statement to export data?

How-to-export-table-data-to-text-file-with-SELECT-INTO-OUTFILE-statement How to export table data to text file with SELECT INTO OUTFILE statement?

How-to-use-mysqldump-to-export-data How to use mysqldump to export data?

How-to-take-dump-of-database-without-its-data How to take dump of database without its data?

How-to-take-dump-of-the-database How to take dump of the database?

About FAQs: Recently Added FAQs

About MySQL FAQs: Site Map | Bookmark Us | Recommend this Site to Your Friend | Contact Us

Useful Links: Wikipedia.org | Oracle.com | w3schools.com | www.php.net | Github.com

© 2023  www.mysqlfaqs.net
All rights reserved.