Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Connection to MySQL DB not working #24

Open
Thatengineerl opened this issue Aug 15, 2020 · 8 comments
Open

Connection to MySQL DB not working #24

Thatengineerl opened this issue Aug 15, 2020 · 8 comments

Comments

@Thatengineerl
Copy link

Hello, So i installed this mod but when it says to go to this IP adress:
image

I see this:
image

I did /dynamap fullrender

What else did I miss?

@Thatengineerl
Copy link
Author

Thatengineerl commented Aug 15, 2020

I also Configured the files in configuration.txt and this is now on the list
image

@lhns
Copy link
Owner

lhns commented Aug 15, 2020

About the first thing:
It seems like you configured the webserver-bindadress.
Are you running dynmap locally on your computer? If so I would just leave that setting commented out. By default dynmap will bind to 0.0.0.0 which means it will be accessible on all of your network interfaces. You can then connect to it with your browser on http://localhost:8123

About the second thing:
If you configured dynmap to use a database you have to add the database drivers manually as they are not included with the mod. With fabric it seems that ony mod jars get loaded so just dropping the database driver jar file into the mods folder will not work. What worked for me was just opening the mod jar and driver jar with a zip program like 7zip and copying everything except META-INF from the driver jar into the mod jar. Just like in the old days of modding.

@Thatengineerl
Copy link
Author

Im installing it on aserver, and ill do that

@lhns
Copy link
Owner

lhns commented Aug 16, 2020

@Thatengineerl Did it work out for you?

@Thatengineerl
Copy link
Author

Not sure how to do what youre asking me to do

@lhns
Copy link
Owner

lhns commented Aug 23, 2020

You might want to jump on our discord server for this kind of support: https://discord.gg/2SMQsHd
I will close this issue for now.

@lhns lhns closed this as completed Aug 23, 2020
@lhns lhns reopened this Aug 25, 2020
@lhns
Copy link
Owner

lhns commented Aug 25, 2020

I will test the mysql backend on my system.

@lhns lhns changed the title Cant Load Map Connection to MySQL DB not working Aug 25, 2020
@lhns
Copy link
Owner

lhns commented Sep 4, 2020

dynmap-fabric-0.2.17+1.16.2 with mariadb via the mysql driver is working for me.

Here is my setup

docker stack file:

version: '3.7'

services:
  fabric:
    image: itzg/minecraft-server
    tty: true
    stdin_open: true
    stop_grace_period: 1m30s
    environment:
      OVERRIDE_SERVER_PROPERTIES: 'true'
      MAX_MEMORY: '7G'
      EULA: 'TRUE'
      VERSION: '1.16.2'
      TYPE: 'FABRIC'
      FABRICVERSION: '0.6.1.45'
      VIEW_DISTANCE: '32'
      SPAWN_PROTECTION: '0'
      ALLOW_FLIGHT: 'TRUE'
    volumes:
      - fabric_data:/data
    networks:
      - db
    ports:
      - "25565:25565"
  mariadb:
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: 'root'
      MYSQL_USER: 'dynmap'
      MYSQL_PASSWORD: 'dynmap'
      MYSQL_DATABASE: 'dynmap'
    volumes:
      - dynmap_db:/var/lib/mysql
    networks:
      - db
    healthcheck:
      test: ['CMD', 'mysqladmin', '--password=root', 'ping']
      timeout: 10s
      retries: 5

networks:
  db:
    driver: overlay

And here is part of my dynmap configuration.txt:

# Map storage scheme: only uncommoent one 'type' value
#  filetree: classic and default scheme: tree of files, with all map data under the directory indicated by 'tilespath' setting
#  sqlite: single SQLite database file (this can get VERY BIG), located at 'dbfile' setting (default is file dynmap.db in data directory)
#  mysql: MySQL database, at hostname:port in database, accessed via userid with password
storage:
  # Filetree storage (standard tree of image files for maps)
  #type: filetree
  # SQLite db for map storage (uses dbfile as storage location)
  #type: sqlite
  #dbfile: dynmap.db
  # MySQL DB for map storage (at 'hostname':'port' in database 'database' using user 'userid' password 'password' and table prefix 'prefix'
  type: mysql
  hostname: mariadb
  port: 3306
  database: dynmap
  userid: dynmap
  password: dynmap
  #prefix: ""

I used the following driver jar:
https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.21/mysql-connector-java-8.0.21.jar

I extracted the org folder from the driver jar and added it to the dynmap-fabric jar.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants