Skip to content
Snippets Groups Projects
Commit 8d6d5abc authored by Thomas  MENARD's avatar Thomas MENARD
Browse files

Revert "Update tutor/templates/hooks/mysql/init"

This reverts commit 55860971
parent 55860971
No related branches found
No related tags found
No related merge requests found
Pipeline #31211 failed
echo "Nothing to do on MySQL..."
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment