-
-
Notifications
You must be signed in to change notification settings - Fork 9
Database Management
Warning
This page is under construction! ⚠
First of all, let's start the DB (if it isn't running yet):
docker compose up mariadb -dFrom within your project's directory:
builder/run.sh backup-db --all > path/to/cmangos_$(date +"%Y-%m-%d_%H-%M-%S").tar.gzFrom within your project's directory:
builder/run.sh restore-db < path/to/cmangos-backup.tar.gzTo execute queries and -more generally- perform various operations on the databases, CMaNGOS Docker provides you both the graphical interface offered by phpMyAdmin and the CLI mysql command within the builder Docker container.
Choose the one that best suits your needs.
phpMyAdmin is included in CMaNGOS Docker but is disabled by default.
To run it, you need to start it manually or specify the debug profile while typing the docker compose command.
If you want to start it manually:
docker compose up phpmyadminIf you want to specify the debug profile:
docker compose --profile debug upIn either case, after running one of these commands, you'll be able to visit the page http://localhost:8080 and perform various operations on the databases with a rather intuitive graphical interface.
A Unix shell (e.g. bash)
Don't forget to replace the <database> placeholder with the name of the database you want to query.
# If you want to execute a single inline query
./builder/run.sh mysql -u root -p <database> -e "SELECT * FROM [...];"# If you need to execute an entire `.sql` file
./builder/run.sh mysql -u root -p <database> < path/to/queries.sqlWindows Command Prompt (cmd.exe)
Don't forget to replace the <version> placeholder with the correct version of the client you want to support and the <database> placeholder with the name of the database you want to query.
REM If you want to execute a single inline query
docker run -it --rm ^
--network "cmangos_default" ^
^
ghcr.io/byloth/cmangos/<version>/builder:latest mysql -u root -p <database> -e "SELECT * FROM [...];"REM If you need to execute an entire `.sql` file
docker run -it --rm ^
--network "cmangos_default" ^
^
ghcr.io/byloth/cmangos/<version>/builder:latest mysql -u root -p <database> < path/to/queries.sqlWindows PowerShell (powershell.exe)
Don't forget to replace the <version> placeholder with the correct version of the client you want to support and the <database> placeholder with the name of the database you want to query.
# If you want to execute a single inline query
docker run -it --rm `
--network "cmangos_default" `
`
ghcr.io/byloth/cmangos/<version>/builder:latest mysql -u root -p <database> -e "SELECT * FROM [...];"# If you need to execute an entire `.sql` file
docker run -it --rm `
--network "cmangos_default" `
`
ghcr.io/byloth/cmangos/<version>/builder:latest mysql -u root -p <database> < path/to/queries.sqlIf you encounter problems with any of the steps described in this documentation, you have found outdated content, it doesn't seem clear enough to you or -in general- if you have any suggestions to improve it, feel free to contribute...
It'll be welcome! 🙃
Warcraft®, World of Warcraft®, The Burning Crusade®, Wrath of the Lich King® and Blizzard Entertainment® are trademarks or registered trademarks of Blizzard Entertainment, Inc. in the U.S. and/or other countries. These terms and all related materials, logos, and images are copyright © Blizzard Entertainment.
This site is in no way associated with or endorsed by Blizzard Entertainment®.