How to Load Text Files into MySQL

MySQL databases are often populated by loading text files directly into tables. MySQL makes this very easy to do with the LOAD DATA INFILE statements. For example:

LOAD DATA INFILE Statements LOAD DATA INFILE statements can read data into MySQL tables at very high speeds. This will be much faster than running many single

read more

Execute MySQL Scripts on the Command Line

When working with MySQL it is often necessary to execute SQL statements or scripts programmatically from the command line. SQL statements can be included in a SQL script (text) file and executed by the MySQL Client. This can be done in a few different ways. Execute MySQL Script File from Standard Input Statements in a

read more

Export data from Postgres as CSV

Exporting data from Postgres as a CSV or tab delimited file can be fairly simple using the COPY command. Examples below. Export an entire table as CSV:

Export an entire table as CSV with Header:

Export query as CSV:

Export query as data tab delimited text file:

Export data directly to

read more