Stochastic Nonsense

Put something smart here.

Writing MySQL Query Results to Disk

Notes to myself: how to easily write query results to disk using mysql.

mysql -h main-backup.local -u earl -e "select count(*) from adsense_analytics_days;" -p collegelist_development > csvname.csv;

where h specifies the name of the mysql server, u the username, e the query, p the database.

This will output a tsv file; to turn it into csv try using sed to transform tabs into commas or with tr.