mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-02-11 13:48:30 +00:00
Make the mysql root username a configuration parameter
This allows users who connect to an external database to customise the root username. Indeed, quite often the "root" username is reserved. Close #328
This commit is contained in:
parent
ae2faea668
commit
3831e2e53d
@ -2,6 +2,10 @@
|
||||
|
||||
Note: Breaking changes between versions are indicated by "💥".
|
||||
|
||||
## Unreleased
|
||||
|
||||
- [Improvement] Make it possible to customize the MySQL root username, for connecting to external MySQL databases
|
||||
|
||||
## v3.12.5 (2020-05-20)
|
||||
|
||||
- [Improvement] Upgrade Android app to v2.21.1 and enable many features, such as downloading videos to SD card. Thanks for the help @ejklock!
|
||||
|
@ -104,12 +104,14 @@ MySQL
|
||||
- ``ACTIVATE_MYSQL`` (default: ``true``)
|
||||
- ``MYSQL_HOST`` (default: ``"mysql"``)
|
||||
- ``MYSQL_PORT`` (default: ``3306``)
|
||||
- ``MYSQL_ROOT_USERNAME`` (default: ``"root"``)
|
||||
- ``MYSQL_ROOT_PASSWORD`` (default: randomly generated) Note that you are responsible for creating the root user if you are using a managed database.
|
||||
|
||||
By default, a running Open edX platform deployed with Tutor includes all necessary 3rd-party services, such as MySQL, MongoDb, etc. But it's also possible to store data on a separate database, such as `Amazon RDS <https://aws.amazon.com/rds/>`_. For instance, to store data on an external MySQL database, set the following configuration::
|
||||
|
||||
ACTIVATE_MYSQL: false
|
||||
MYSQL_HOST: yourhost
|
||||
MYSQL_ROOT_USERNAME: <root user name>
|
||||
MYSQL_ROOT_PASSWORD: <root user password>
|
||||
|
||||
Elasticsearch
|
||||
|
@ -64,6 +64,7 @@ OPENEDX_MYSQL_DATABASE: "openedx"
|
||||
OPENEDX_MYSQL_USERNAME: "openedx"
|
||||
MYSQL_HOST: "mysql"
|
||||
MYSQL_PORT: 3306
|
||||
MYSQL_ROOT_USERNAME: "root"
|
||||
NGINX_HTTP_PORT: 80
|
||||
NGINX_HTTPS_PORT: 443
|
||||
PLATFORM_NAME: "My Open edX"
|
||||
|
@ -1,7 +1,7 @@
|
||||
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'
|
||||
until mysql -u {{ MYSQL_ROOT_USERNAME }} --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)..."
|
||||
@ -14,5 +14,5 @@ do
|
||||
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 }}";'
|
||||
mysql -u {{ MYSQL_ROOT_USERNAME }} --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'CREATE DATABASE IF NOT EXISTS {{ OPENEDX_MYSQL_DATABASE }};'
|
||||
mysql -u {{ MYSQL_ROOT_USERNAME }} --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 }}";'
|
Loading…
x
Reference in New Issue
Block a user