Last active
March 23, 2016 03:55
-
-
Save luciuschoi/6e6065e1b0eae1c9bdfc to your computer and use it in GitHub Desktop.
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
# 먼저 원격 우분투 서버로 접속한 후 mysql을 설치한다. | |
# 그리고, 아래와 같이 root계정으로 mysql에 접속한다. | |
``` | |
$ mysql -u root -p | |
``` | |
아래의 명령을 실행하여 데이터베이스 및 배포용 유저를 생성하고 모든 권한 부여 한다. | |
``` | |
mysql> create database app1_production; | |
mysql> create user deployer@localhost identified by "password"; | |
mysql> grant all privileges on * . * to deployer@localhost; | |
``` | |
그리고 database.yml 파일을 열고 아래와 같이 변경한다. | |
production: | |
adapter: mysql2 | |
encoding: utf8 | |
pool: 5 | |
host: localhost | |
database: app1_production | |
username: <%= ENV['APP1_DATABASE_USER'] %> | |
password: <%= ENV['APP1_DATABASE_PASSWORD'] %> | |
여기서 유저명과 비밀번호는 환경변수를 이용한다. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment