Skip to content

Instantly share code, notes, and snippets.

@mheadd
Last active December 22, 2015 02:49
Show Gist options
  • Select an option

  • Save mheadd/6406234 to your computer and use it in GitHub Desktop.

Select an option

Save mheadd/6406234 to your computer and use it in GitHub Desktop.

Install MySQL:

~$ sudo apt-get install mysql-server

Ensure MySQL is running:

~$ pgrep mysql

Create a temporary location for the GTFS files:

~$ mkdir /tmp/dartfirst_de_us

Download the GTFS files from the Delaware Transit Agency website:

~$ wget http://www.dartfirststate.com/information/routes/gtfs_data/dartfirststate_de_us.zip

Unzip the individual text files to our temporary location:

~$ unzip dartfirststate_de_us.zip -d /tmp/dartfirst_de_us/

Get the SQL script for loading GTFS files into MySQL from GitHub:

~$ wget http://gist.github.com/raw/615470/7f62e8354d680011f7eea5f9afcfd0ae93a6fedb/dartfirststate_de_us.sql

Invoke MySQL and pass in the SQL script (make sure you change 'user_name' to a valid MySQL user name):

~$ mysql -u user_name -p < dartfirststate_de_us.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment