-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instructions to setup local MySQL and Postgres #3868
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1a29f21
Add instructions to setup local MySQL and Postgres
yux0 7f73313
Add instructions to setup local MySQL and Postgres
yux0 a7036a0
Address comments
yux0 af0fbf1
Merge branch 'db_setup' of ssh://github.com/uber/cadence into db_setup
yux0 c499891
Add instructions to setup local MySQL and Postgres
yux0 d86fc7e
Address comments
yux0 163e72c
update path
yux0 558478b
Update path
yux0 b41c0d2
Merge branch 'master' into db_setup
yux0 d4853c2
Merge branch 'master' into db_setup
yux0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Setup local MySQL with Docker | ||
This document describes how to install MySQL 5.7 locally with Docker. | ||
|
||
>Note: Install the docker on your machine before installing the MySQL. | ||
* Make sure any MySQL containers are terminated and removed | ||
``` | ||
docker ps -a | ||
docker kill <container_id> && docker rm <container_id> # remove any MySQL containers. | ||
``` | ||
* Fetch docker image (version 5.7 is what Travis runs so its what you will want locally) | ||
``` | ||
docker pull mysql/mysql-server:5.7 | ||
``` | ||
* Run docker container (note the port mapping so that 3306 is exposed locally) | ||
``` | ||
docker run -p 3306:3306 --name=mysql1 -d mysql/mysql-server:5.7 | ||
``` | ||
* When docker starts up the root MySQL user will have an auto generated password. You need to get that password to log into the container | ||
``` | ||
docker logs mysql1 2>&1 | grep GENERATED | ||
# The result looks like: [Entrypoint] GENERATED ROOT PASSWORD: iHqEvRYm6UP#YN$es;YnV3m(oJ | ||
``` | ||
* Log into the container (when prompted for password use the password gotten from last step). | ||
``` | ||
docker exec -it mysql1 mysql -uroot -p | ||
``` | ||
* Before any SQL operations can be performed you must reset the root user's password (use anything you like in replace of root_password). | ||
``` | ||
SET PASSWORD = PASSWORD('root_password'); | ||
``` | ||
* Now create the user that local MySQL tests will use. Also grant all privileges to user. | ||
``` | ||
CREATE USER 'uber'@'%' IDENTIFIED BY 'uber'; | ||
GRANT ALL PRIVILEGES ON *.* TO 'uber'@'%'; | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Setup local Postgres with Docker | ||
This document describes how to install latest Postgre locally with Docker. | ||
|
||
>Note: Install the docker on your machine before installing the MySQL. | ||
* Make sure any MySQL containers are terminated and removed | ||
``` | ||
docker ps -a | ||
docker kill <container_id> && docker rm <container_id> # remove any Postgres containers. | ||
``` | ||
* Fetch docker image | ||
``` | ||
docker pull postgres | ||
``` | ||
* Run docker container (note the port mapping so that 5432 is exposed locally) | ||
``` | ||
mkdir -p ~/docker/volumes/postgres | ||
docker run --rm --name pg-docker -e POSTGRES_PASSWORD=cadence -d -p 5432:5432 -v ~/docker/volumes/postgres:/var/lib/postgresql/data postgres | ||
``` | ||
* Log into the container (when prompted for password use the password gotten from last step). | ||
``` | ||
psql -h localhost -U postgres -d cadence | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why
readme
? this name doesn't give any useful information. Maybesetup
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the dir name