Skip to content

Commit

Permalink
chore: 테스트 서버 mysql 설치 스크립트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
5uhwann committed Jul 9, 2024
1 parent e6d38f7 commit 0958b83
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions .ebextensions/install_mysql.config
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
packages:
yum:
wget: []
openssl-libs: []
compat-openssl10: []
docker: []

commands:
01_add_mysql_repo:
command: |
sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm -O /tmp/mysql80-community-release-el7-3.noarch.rpm && \
sudo rpm -Uvh /tmp/mysql80-community-release-el7-3.noarch.rpm && \
sudo yum clean all
ignoreErrors: false
test: test ! -f /etc/yum.repos.d/mysql-community.repo

02_install_mysql:
command: "sudo yum -y install mysql-community-server"
ignoreErrors: false

03_start_mysql:
command: "sudo service mysqld start"
01_start_docker_service:
command: "sudo service docker start"
ignoreErrors: false

04_create_database:
command: "mysql -u root -e 'CREATE DATABASE IF NOT EXISTS ddingdong_test'"
02_pull_mysql_image:
command: "sudo docker pull mysql:8.0"
ignoreErrors: false

05_create_user:
03_run_mysql_container:
command: |
mysql -u root -e "CREATE USER IF NOT EXISTS 'myuser'@'localhost' IDENTIFIED BY 'mypassword';" && \
mysql -u root -e "GRANT ALL PRIVILEGES ON ddingdong_test.* TO 'myuser'@'localhost';" && \
mysql -u root -e "FLUSH PRIVILEGES;"
sudo docker run -d \
--name=mysql80 \
-e MYSQL_ROOT_PASSWORD=ddingdong \
-e MYSQL_DATABASE=ddingdong_test \
-e MYSQL_USER=myuser \
-e MYSQL_PASSWORD=ddingdong \
-p 3306:3306 \
mysql:8.0
ignoreErrors: false

0 comments on commit 0958b83

Please sign in to comment.