diff --git a/docker-compose.yml b/docker-compose.yml index 138935d8..0b7f7ddb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: env_file: - .env environment: - - MYSQL_ROOT_HOST="0.0.0.0" + - MYSQL_ROOT_HOST=% ports: - "5306:3306" volumes: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f0390fe7..440cfef7 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -171,8 +171,24 @@ docker exec -it student_dashboard_mysql mysql_upgrade \ When prompted, specify the password for the root MySQL user. It should be found in the `MYSQL.ROOT_PASSWORD` property of `env.hjson`. -[Next: Contributors](../docs/CONTRIBUTORS.md) +### Backing up the development database + +To backup the development databaes with the default settings, use this command +```sh +docker exec student_dashboard_mysql mysqldump --socket=/tmp/mysql.sock -uroot -pstudent_dashboard_root_pw student_dashboard > student_dashboard.sql +``` + +To restore this database to a new database you had created as an admin called student_dashboard_new (CREATE database student_dashboard_new). You can also just restore it to the same database (student_dashboard). + +```sh +docker exec -i student_dashboard_mysql mysql -uroot -pstudent_dashboard_root_pw student_dashboard < student_dashboard.sql +``` + +Note: It's possible you may need to recreate the database (delete the .data directory) if your value in docker-compose was `MYSQL_ROOT_HOST="0.0.0.0"` which makes it difficult to connect to MySQL. ### Dependency Upgrade For Auto-upgrade django to future version, use the helpful library called [django-upgrade](https://github.com/adamchainz/django-upgrade ) + +[Next: Contributors](../docs/CONTRIBUTORS.md) +