Skip to content
Snippets Groups Projects
Commit 1038da61 authored by dimitriskr's avatar dimitriskr Committed by Andrey Postnikov
Browse files

MariaDB 10.3.22 - remove "create user" statement #3399858

(cherry picked from commit 35797df4)
parent afc79a49
Branches
No related tags found
No related merge requests found
Pipeline #54556 passed
####
FROM mariadb:10.3.22
FROM docker.io/mariadb:10.3.22
MAINTAINER drupalci
# Packages..
RUN apt-get -y update && \
apt-get -y install netcat psmisc
RUN apt-get clean && apt-get autoclean && apt-get -y autoremove
RUN apt-get -y update || true; \
apt-get -y install netcat psmisc --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
COPY ./conf/my.cnf /etc/mysql/conf.d/drupalci.cnf
COPY ./conf/setup.sql /docker-entrypoint-initdb.d/setup.sql
RUN rm -rf /var/lib/mysql/*
USER root
......
CREATE USER 'drupaltestbot'@'%' IDENTIFIED BY 'drupaltestbotpw';
GRANT ALL PRIVILEGES ON *.* TO 'drupaltestbot'@'%' WITH GRANT OPTION;
SELECT User FROM mysql.user;
FLUSH PRIVILEGES;
#!/bin/bash
MYSQL_ALLOW_EMPTY_PASSWORD=yes /usr/local/bin/docker-entrypoint.sh mysqld
if [ ! -f /var/lib/mysql/ibdata1 ];
then
echo "rebuilding /var/lib/mysql/ibdata1"
mysql_install_db --user=mysql --basedir=/usr/ --datadir=/var/lib/mysql/
test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
/usr/bin/mysqld_safe &
PID="${!}"
sleep 5s
while ! netcat -vz localhost 3306; do sleep 1; done
mysql -e "CREATE USER 'drupaltestbot'@'%' IDENTIFIED BY 'drupaltestbotpw';"
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'drupaltestbot'@'%' WITH GRANT OPTION; SELECT User FROM mysql.user; FLUSH PRIVILEGES;"
echo "Grants added"
killall mysqld
wait ${PID}
fi
/usr/bin/mysqld_safe;
echo "mysql died at $(date)";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment