Another attempt at setting up the database properly

This commit is contained in:
WilliamMiceli
2019-11-22 22:31:47 -05:00
parent 12c609cade
commit 328b40f0f6
2 changed files with 7 additions and 7 deletions

View File

@@ -17,13 +17,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
COPY /etc/ /etc/
# Setting up MySQL --Will come back to later, as it's not necessary and not playing very well with automation
RUN mysql -u root <<-EOF
UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
FLUSH PRIVILEGES;
EOF
RUN mysql -u root < mysql_setup.sql
# Copying in startup script
COPY /entrypoint.sh /

5
mysql_setup.sql Normal file
View File

@@ -0,0 +1,5 @@
UPDATE mysql.user SET authentication_string=PASSWORD('Password1234') WHERE User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
FLUSH PRIVILEGES;