How to fetch data from MySQL database table into Excel?
Install Connector/ODBC
Create an ODBC DSN (Control Panel / Administration / ODBC if on Windows)
Import data using Microsoft Query (Data / External Data / From Other Sources / Microsoft Query in Excel 2007)
If your server is also your client machine you can do
select * from table1 into outfile 'c:/path/outfile.csv'
(Note the use of forward slashes even on Windows)
If your server is a remote machine, make sure your have the MySQL client software installed on the client machine and do:
mysql -e "SELECT * from table1" > file_name
You can then open the csv file in Excel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With