Skip to content

Instantly share code, notes, and snippets.

View jasperboyd's full-sized avatar

Jasper Boyd jasperboyd

View GitHub Profile
@jasperboyd
jasperboyd / mysql_splitdump.sh
Last active February 4, 2021 15:06 — forked from jasny/mysql_splitdump.sh
Split MySQL dump SQL file into one file per table or extract a single table from https://stackoverflow.com/questions/132902/how-do-i-split-the-output-from-mysqldump-into-smaller-files
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on https://gist.github.com/jasny/1608062
####
#adjust this to your case:
START="/-- Table structure for table/"
# or
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default