Answers for "export query result mysql data to excel"

SQL
1

mysql query return excel file

#Before exectue query in sql run following command:
sudo chmod 755 -R /var/lib/mysql/

#run query in mysql
SELECT ... FROM ... WHERE ... 
INTO OUTFILE 'file.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY 'n';

#Then Open Excel and click on Data tab, 
#Click the From Text/CSV button,
#Navigate to the location of the exported .csv file and click Import
#Choose appropriate delimiter "comma"and click Transform Data
#Update column name, Close & Load.
Posted by: Guest on November-15-2020

Code answers related to "export query result mysql data to excel"

Code answers related to "SQL"

Browse Popular Code Answers by Language