Update 'Magicbox external database setup'
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
> The MagicBox is a transient thing; it lasts only until the container is stopped. Users must configure an external database if they wish for their world to persist.
|
> The MagicBox is a transient thing; it lasts only until the container is stopped. Users must configure an external database if they wish for their world to persist.
|
||||||
|
|
||||||
For utility we will use a MySQL container for this purpose.
|
For utility we will use a MySQL container for this purpose. The assumtption is made that mysql-client is installed on the host machine.
|
||||||
|
|
||||||
`$ docker pull mysql:latest`
|
`$ docker pull mysql:latest`
|
||||||
|
|
||||||
Now let's spin up our new mysql server. Choose your own root password here.
|
Spin up our new mysql server. Choose your own root password here.
|
||||||
|
|
||||||
`$ docker run --name mysql -p 3306:3306 -v mysql_volume:/var/lib/mysql/ -d -e "MYSQL_ROOT_PASSWORD=ROOTPASS" mysql`
|
`$ docker run --name mysql -p 3306:3306 -v mysql_volume:/var/lib/mysql/ -d -e "MYSQL_ROOT_PASSWORD=ROOTPASS" mysql`
|
||||||
|
|
||||||
@@ -22,3 +22,14 @@ CREATE DATABASE magicbane;
|
|||||||
GRANT ALL PRIVILEGES ON *.* TO 'magicbox'@'%';
|
GRANT ALL PRIVILEGES ON *.* TO 'magicbox'@'%';
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Excute these instructions on the new mysql server
|
||||||
|
|
||||||
|
`$ mysql -u root -p < mbremotesql.conf`
|
||||||
|
|
||||||
|
Now log onto your Magicbox instance and dump the database with `./mbdump.sh`
|
||||||
|
|
||||||
|
Move that file onto the host either via mb.conf or docker cp. Restore the database to your new mysql instance.
|
||||||
|
|
||||||
|
`$ mysql -u magicbox -p < mbdump.sql`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user