How to Create an XLS File From MySQL Results
The MySQL Query Browser is a powerful administrative tool that allows you to send queries directly to your database and return a piece of information known as a result set. Included with many MySQL installations and freely available from the MySQL website, the query browser features the ability to save query results in a number of formats. The XLS format for Microsoft Excel is natively supported by the browser and makes exporting MySQL data into a spreadsheet a quick task.
Instructions
-
-
1
Obtain the MySQL query browser if you do not already have it. It is part of the MySQL GUI Tools, which are located on the the MySQL website. The manual includes comprehensive installation instructions for your operating system.
-
2
Open the MySQL Query Browser and enter the server name, user name and password for your MySQL server. Select your database and enter the SQL query you would like to run in the query area at the top of the screen.
-
-
3
The main window in the middle-left of the screen will display your MySQL results. Right-click these results and select "Export Resultset" on the drop-down dialog. Select "XLS" as your export format and choose the location on your hard drive where you would like to save the file. You have now saved your MySQL results as an XLS spreadsheet.
-
1
Tips & Warnings
Be sure you are running SELECT commands when gathering data, as DELETE and UPDATE commands will alter your database.
References
Resources
- Photo Credit deep in database image by .shock from Fotolia.com