Skip to content

Instantly share code, notes, and snippets.

@epequeno
Last active August 29, 2015 14:00
Show Gist options
  • Save epequeno/000acfc119450be2b19c to your computer and use it in GitHub Desktop.
Save epequeno/000acfc119450be2b19c to your computer and use it in GitHub Desktop.
A simple script to create a MySQL db and table
MAKE SURE ALL FILES ARE IN THE SAME FOLDER
in a file named lab.sh:
#!/bin/bash
mysql < mysql.sql
mysqldump FastFood > station12.sql
rsync -P station12.sql coby@172.21.101.105:~/
in a file named mysql.sql:
DROP DATABASE IF EXISTS FastFood;
CREATE DATABASE FastFood;
USE FastFood;
CREATE TABLE McD (
id INT UNSIGNED NOT NULL,
type VARCHAR(30)
);
CREATE TABLE Wendys (
id INT UNSIGNED NOT NULL,
type VARCHAR(30)
);
make lab.sh executable and run with ./lab.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment