#Database connection via Plugin in Minecraft

117 messages · Page 1 of 1 (latest)

cunning haven
#

Hello Guys, i am running into a problem since May 9th. I didn´t chance anything at all and somehow all my databases can´t be reached from the Pterodactyl database names and passwords. I can create a Database but the plugin won´t connect to it. I tried with HeidiSQL to see if the database is there and can connect to it. That works. I even reinstalled Ubuntu 24.04 and set up Pterodactyl from scratch, everything works. I try using LuckPerms to connect to mariadb.
Latest Logs: https://pastebin.com/mbS2SHMT

atomic pilotBOT
cunning haven
#

i tried using the 172.18.0.1 with the port, without the port, with quotation marks and without. Still getting the same error message.
the mysql tutorial i did follow and thats working aswell

odd root
#

why is your port 25566 for mariadb
does it listen on that port

cunning haven
#

wait a sec, its a typo, i try with 3306

#

not working either

placid cloud
#

why not used 192.168.1.22:3306 ?

cunning haven
#

unfortunatly it doesn´t work either

#

i just wanted to check the grants in mysql and now when i try to do this it says

odd root
#

how does your my.conf look

cunning haven
odd root
#

it should be mysqld

#

that is the correct name for the server group that setting should be in

#

also

#

put it below the !includedir's

#

at the very bottom

#

then restart mariadb

cunning haven
#

like this then?

odd root
#

yea

#

the d is for daemon, mysqldaemon

#

or shortened mysqld

#

after that it should be listening on all interfaces

#

so 172.18.0.1 should work if it's on the same machine

cunning haven
#

i restarted the mysql and mariadb, and restarted the minecraft server, but still no connection.
tried it with 172.18.0.1

odd root
#

hm oke

cunning haven
#

i reboot whole server

odd root
#

make sure mariadb is listening on all interfaces by checking the listens

#

damn oke

cunning haven
#

its a homeserver, its up in a sec 🙂

placid cloud
#

mysql and mariadb ? will it not conflicting ?

odd root
#

mariadb uses my.conf too

#

and the mysqld options

#

sudo netstat -tulpn | grep mariadb

#

this should show you what port and interfaces mariadb listens on

cunning haven
#

it listens

odd root
#

yep listening on 3306 on all interfaces

#

so it should accept connections from everywhere

#

btw how are your firewall rules

cunning haven
#

firewall is down from the server and i portforwarded it in my modem

odd root
#

you'll need to allow access to 3306 for the containers

cunning haven
#

its disabled

odd root
#

that doesn't turn off your firewall

#

ufw is just a wrapper for iptables/nftables, which is the actual firewall running behind it

#

disabling ufw will just disable the ufw managed rules but not the firewall itself

#

which is a bad idea in general anyways, firewalls exist for a good reason

cunning haven
#

yea i know that, i wanted to turn it on when all works and the ports are managed what i have to forward

odd root
#

you need to enable nginx full, your wings ports, by default 8080 and 2022 and ssh

#

so do sudo ufw default allow outgoing && sudo ufw default deny incoming && sudo ufw allow SSH && sudo ufw allow 'Nginx Full' && sudo ufw allow 8080 && sudo ufw allow 2022 && sudo ufw enable

#

then you need to add a rule for ptero too

cunning haven
#

the ssh says it couldnt find a match, but i am in my server with ssh atm

odd root
#

Then try OpenSSH

#

if that doesn't find a match just make it allow 22

#

and also this one
ufw allow in on pterodactyl0 to 172.18.0.1 port 3306 proto tcp

cunning haven
#

ok, all worked

odd root
#

well restart wings and check if it can connect

atomic pilotBOT
#

Simple! 😘

systemctl restart wings
cunning haven
#

unfortunatly no

odd root
#

hm oke

#

can you connect to the db in terminal

#

so like mariadb -u user -p password for the user ptero made for the db

#

also use mysql as driver in the luckperms config not mariadb

#

mariadb is not a driver it recognizes

#

so storage-driver: mysql

#

in the luckperms config

#

it will be able to connect to mariadb using that still

cunning haven
#

i changed the mariadb to mysql, doesnt work
in the database i can connect

odd root
#

hm oke

cunning haven
odd root
#

no use u3_whatever

#

not your user

#

to check if that user works

cunning haven
#

ok

odd root
#

also what connections are allowed for it? %?

cunning haven
#

yes

#

can connect to

odd root
#

weird

#

your container should be able to connect too then

cunning haven
#

thought the same

odd root
#

wings is on the same machine as the db right

cunning haven
#

yes, all on 1 machine

odd root
#

hmm

#

what is your config like again

cunning haven
odd root
#

mine is just like that too but works weird

#

hm

cunning haven
#

it happens like overnight, didnt change a bit, dead

odd root
#

case sensitivity shouldn't matter, but does it change anything if you try MySQL instead of mysql

#

also what error are you getting on boot on your mc server

#

since luckperms only tries reconnecting to db on boot

cunning haven
odd root
#

luckperms-hikari - Connection is not available, request timed out after 5001ms

#

hmm

#

it times out

#

seems like there's still an issue with the firewall

#

try sudo ufw reload

#

also sudo ufw status verbose

#

to check if the rules are all applied

cunning haven
#

they are, i guess

#

does the pterodactyl0 takes a role? like could it be another name?

odd root
#

no should usually be that name

#

you can check too ig

cunning haven
#

so like, i didnt specify the name somewhere, where i could take another

odd root
#

pterodactyl0 is the default name for the docker interface that wings makes

cunning haven
#

i also checked the gateway, it is 172.18.0.1, so thats alright too

#

bridges looks fine too

odd root
#

weird

cunning haven
#

i am clueless

odd root
#

yea me too

#

everything seems fine

cunning haven
#

i am reviewing the logs from the server. same day it works, 6h later it doesnt xD

#

it was a auto restart from the server, didnt do anything to it

cunning haven
#

so i guess i found the error

#

you wouldnt believe it when i told you i set the timeout time to 10 seconds

#

i am crying