From cc71a019dce5346bd0ec1ab7a05074e69c691ddd Mon Sep 17 00:00:00 2001 From: Chase Wright Date: Fri, 13 Oct 2017 10:52:34 -0500 Subject: [PATCH] MySQL Sleep --- docker-install.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-install.sh b/docker-install.sh index 8274591..5012e47 100644 --- a/docker-install.sh +++ b/docker-install.sh @@ -22,13 +22,16 @@ tar -xzf guacamole-auth-jdbc-${VERSION}-incubating.tar.gz # Start MySQL docker run --restart=always --detach --name=mysql --env="MYSQL_ROOT_PASSWORD=$MYSQLROOTPASSWORD" --publish 3306:3306 mysql -# Create the Guacamole database and the user account +# Sleep to let MySQL load (there's probably a better way to do this) +echo "Waiting 30 seconds for MySQL to load" +sleep 30 +# Create the Guacamole database and the user account # SQL Code SQLCODE=" -create database guacamole_db; -create user 'guacamole_user'@'%' identified by '$guacdbuserpassword'; -GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'%'; +create database guacamole_db; +create user 'guacamole_user'@'%' identified by '$guacdbuserpassword'; +GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'%'; flush privileges;" # Execute SQL Code