top of page

Create a file for result of query by using MySQL

To create a file for result of query by using MySQL.


You can use the following:


Firstly, you may need to set the destination file path instead of '[Output_File_Path]',

Example : 'C:/MySQL_Output/'


FIELDS TERMINATED BY '\n'

Which delimiter the columns are delimited. Here '\n' is using as delimiter.



OPTIONALLY ENCLOSED BY '' 

Any whitespace at the beginning of the field is skipped.



ESCAPED BY ''

Controls how to read or write special characters. Here nothing.



LINES TERMINATED BY '\n'

Used to separate lines.


Example:



Edited (24/7/2019)

If there is double quote in the value of one of the field.



Single post: Blog_Single_Post_Widget
bottom of page