Skip to content

Commit

Permalink
Merge pull request #40 from sebbaum/v1
Browse files Browse the repository at this point in the history
Implemented possibility to configure charset and collation for MySQL DB
  • Loading branch information
sebbaum authored Oct 5, 2021
2 parents 92a56d5 + 28d5d98 commit 604fe97
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.16.3
v1.17.0
9 changes: 9 additions & 0 deletions configure/box.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,18 @@ node:
# If the file exists, it is copied to /tmp/mysql/migration.sql in the vagrant box and imported by the mysql.sh
# provisioning script.
#
# Examples for charset and collation
# charset: latin1
# collation: latin1_swedish_ci
#
# charset: utf8
# collation: utf8_general_ci
#
########################################################################################################################
mysql:
MYSQL_DATABASE: mydb
MYSQL_DATABASE_CHARSET: latin1
MYSQL_DATABASE_COLLATION: latin1_swedish_ci
MYSQL_ROOT_PASSWORD: root!
MYSQL_USER_NAME: app
MYSQL_USER_PASSWORD: app!
Expand Down
2 changes: 1 addition & 1 deletion provisioning/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -e "USE mysql; UPDATE user SET host='%'
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -e "FLUSH PRIVILEGES;" > /dev/null 2>&1

# Create the database
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -e "CREATE database ${MYSQL_DATABASE};" > /dev/null 2>&1
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -e "CREATE database ${MYSQL_DATABASE} CHARACTER SET ${MYSQL_DATABASE_CHARSET} COLLATE ${MYSQL_DATABASE_COLLATION};" > /dev/null 2>&1

# Create the application's user
mysql -u root -p"${MYSQL_ROOT_PASSWORD}" -e "USE mysql; CREATE USER '${MYSQL_USER_NAME}'@'localhost' IDENTIFIED BY '${MYSQL_USER_PASSWORD}';" > /dev/null 2>&1
Expand Down

0 comments on commit 604fe97

Please sign in to comment.