From 5586097146b73ea2018b62d70596648bb9ee9632 Mon Sep 17 00:00:00 2001 From: Thomas MENARD <thomas.menard@pasteur.fr> Date: Wed, 27 May 2020 17:45:32 +0200 Subject: [PATCH] Update tutor/templates/hooks/mysql/init --- tutor/templates/hooks/mysql/init | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tutor/templates/hooks/mysql/init b/tutor/templates/hooks/mysql/init index 91d327f..e545a2a 100644 --- a/tutor/templates/hooks/mysql/init +++ b/tutor/templates/hooks/mysql/init @@ -1,18 +1 @@ -echo "Initialising MySQL..." -mysql_connection_max_attempts=10 -mysql_connection_attempt=0 -until mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'exit' -do - mysql_connection_attempt=$(expr $mysql_connection_attempt + 1) - echo " [$mysql_connection_attempt/$mysql_connection_max_attempts] Waiting for MySQL service (this may take a while)..." - if [ $mysql_connection_attempt -eq $mysql_connection_max_attempts ] - then - echo "MySQL initialisation error" 1>&2 - exit 1 - fi - sleep 10 -done -echo "MySQL is up and running" - -mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'CREATE DATABASE IF NOT EXISTS {{ OPENEDX_MYSQL_DATABASE }};' -mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'GRANT ALL ON {{ OPENEDX_MYSQL_DATABASE }}.* TO "{{ OPENEDX_MYSQL_USERNAME }}"@"%" IDENTIFIED BY "{{ OPENEDX_MYSQL_PASSWORD }}";' \ No newline at end of file +echo "Nothing to do on MySQL..." -- GitLab