trying to commit with my voyager is too complicated at the moment
This commit is contained in:
parent
778e1a9056
commit
4a60057513
10 changed files with 130 additions and 62 deletions
19
srcs/requirements/mariadb/tools/start_db.sh
Normal file
19
srcs/requirements/mariadb/tools/start_db.sh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
sudo -u mysql -s /bin/sh -c mysqld &
|
||||
PID=$!
|
||||
|
||||
mariadb-admin status --wait
|
||||
|
||||
mariadb -e "CREATE DATABASE IF NOT EXISTS ${DB_NAME};"
|
||||
mariadb -e "CREATE USER IF NOT EXISTS '${DB_USER}'@'%' IDENTIFIED BY '${DB_PASSWORD}';"
|
||||
mariadb -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%';"
|
||||
mariadb -e "FLUSH PRIVILEGES;"
|
||||
|
||||
sudo -u mysql -s /bin/sh -c "mysqladmin shutdown"
|
||||
wait "$PID"
|
||||
|
||||
sed -i /etc/my.cnf.d/mariadb-server.cnf -e 's/^port=3307$/\0\nbind-address = 0.0.0.0/'
|
||||
sed -i /etc/my.cnf.d/mariadb-server.cnf -e 's/^skip-networking$/;\0/'
|
||||
|
||||
exec sudo -u mysql -s /bin/sh -c mysqld
|
||||
Loading…
Add table
Add a link
Reference in a new issue