Skip to content

Commit

Permalink
Added posibility for custom SQL scripts during DB init
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneft committed Aug 28, 2022
1 parent bd4db6a commit d50bc7b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ create_db_database_mysql() {

if [ -z ${DB_EXISTS} ]; then
echo "** Database '${DB_SERVER_DBNAME}' does not exist. Creating..."
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin" 1>/dev/null
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET ${DB_CHARACTER_SET} COLLATE ${DB_CHARACTER_COLLATE}" 1>/dev/null
# better solution?
mysql_query "GRANT ALL PRIVILEGES ON $DB_SERVER_DBNAME. * TO '${DB_SERVER_ZBX_USER}'@'%'" 1>/dev/null
else
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ create_db_database_mysql() {

if [ -z ${DB_EXISTS} ]; then
echo "** Database '${DB_SERVER_DBNAME}' does not exist. Creating..."
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin" 1>/dev/null
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET ${DB_CHARACTER_SET} COLLATE ${DB_CHARACTER_COLLATE}" 1>/dev/null
# better solution?
mysql_query "GRANT ALL PRIVILEGES ON $DB_SERVER_DBNAME. * TO '${DB_SERVER_ZBX_USER}'@'%'" 1>/dev/null
else
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ create_db_database_mysql() {

if [ -z ${DB_EXISTS} ]; then
echo "** Database '${DB_SERVER_DBNAME}' does not exist. Creating..."
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin" 1>/dev/null
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET ${DB_CHARACTER_SET} COLLATE ${DB_CHARACTER_COLLATE}" 1>/dev/null
# better solution?
mysql_query "GRANT ALL PRIVILEGES ON $DB_SERVER_DBNAME. * TO '${DB_SERVER_ZBX_USER}'@'%'" 1>/dev/null
else
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ create_db_database_mysql() {

if [ -z ${DB_EXISTS} ]; then
echo "** Database '${DB_SERVER_DBNAME}' does not exist. Creating..."
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin" 1>/dev/null
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET ${DB_CHARACTER_SET} COLLATE ${DB_CHARACTER_COLLATE}" 1>/dev/null
# better solution?
mysql_query "GRANT ALL PRIVILEGES ON $DB_SERVER_DBNAME. * TO '${DB_SERVER_ZBX_USER}'@'%'" 1>/dev/null
else
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ create_db_database_mysql() {

if [ -z ${DB_EXISTS} ]; then
echo "** Database '${DB_SERVER_DBNAME}' does not exist. Creating..."
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_bin" 1>/dev/null
mysql_query "CREATE DATABASE ${DB_SERVER_DBNAME} CHARACTER SET ${DB_CHARACTER_SET} COLLATE ${DB_CHARACTER_COLLATE}" 1>/dev/null
# better solution?
mysql_query "GRANT ALL PRIVILEGES ON $DB_SERVER_DBNAME. * TO '${DB_SERVER_ZBX_USER}'@'%'" 1>/dev/null
else
Expand Down

0 comments on commit d50bc7b

Please sign in to comment.