mirror of
https://github.com/Ladebeze66/Inception.git
synced 2026-11-09 13:47:09 +01:00
ff
This commit is contained in:
20
srcs/requirements/mariadb/tools/entrypoint.sh
Normal file
20
srcs/requirements/mariadb/tools/entrypoint.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting MariaDB..."
|
||||
service mariadb start
|
||||
|
||||
sleep 2
|
||||
|
||||
echo "Creating user..."
|
||||
mysql -e "CREATE USER IF NOT EXISTS \`${MYSQL_USER}\`@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';"
|
||||
mysql -e "GRANT ALL PRIVILEGES ON \`${MYSQL_DATABASE}\`.* TO '${MYSQL_USER}'@'%';"
|
||||
|
||||
mysql -e "FLUSH PRIVILEGES;"
|
||||
|
||||
echo "Generating database..."
|
||||
mysql -e "CREATE DATABASE IF NOT EXISTS ${MYSQL_DATABASE};"
|
||||
|
||||
echo "Stopping MariaDB..."
|
||||
mysqladmin -u root shutdown
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user