Last active
August 29, 2015 14:00
-
-
Save epequeno/000acfc119450be2b19c to your computer and use it in GitHub Desktop.
A simple script to create a MySQL db and table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected]:~/ | |
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