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

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" 
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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How can I change URL directly in the database?

If you know how to access phpMyAdmin on your host, then you can edit these values directly to...

How do you repair a MySQL database table?

Every once in a while, it may be necessary to repair one or more MySQL database tables....

Why does WordPress only support MySQL? What about DB abstraction?

While in theory supporting more databases is better than supporting one, in practice focusing...

Error 1251: Client does not support authentication protocol requested by server

Database admin user name and/or password is invalid (Error 1251: Client does not support...

What is MySQL?

Prided for its cost-effective delivery of high performance eCommerce on a large scale, MYSQL...