Last active
August 29, 2015 14:01
-
-
Save dmulvi/fe3081c5c181875709cf to your computer and use it in GitHub Desktop.
Setup a simple database
This file contains 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
DROP DATABASE IF EXISTS twitter_test; | |
CREATE DATABASE twitter_test; | |
USE twitter_test; | |
DROP TABLE IF EXISTS follwers; | |
CREATE TABLE followers ( | |
id varchar(16), | |
screen_name VARCHAR(32), | |
name VARCHAR(32), | |
url VARCHAR(128), | |
followers INT, | |
following INT | |
); | |
DROP TABLE IF EXISTS location; | |
CREATE TABLE location ( | |
id varchar(16), | |
location VARCHAR(64) | |
); | |
GRANT USAGE ON twitter_tester.* TO 'twitter_tester'@'localhost' IDENTIFIED BY 'password'; | |
DROP USER 'twitter_tester'@'localhost'; | |
# ^^ hacky way to support DROP USER IF EXISTS type functionality | |
CREATE USER 'twitter_tester'@'localhost' IDENTIFIED BY 'JURjdJErOtLEg'; | |
# no need to get all excited about the password, it is just a random string only used for this | |
GRANT ALL ON twitter_test.* TO twitter_tester; | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment