Having issues with MySQL databases in Pterodactyl.
I bought a dedicated server from PebbleHost and I'm making databases to connect my plugins to however none of the plugins will connect despite trying all different combinations of hosts and such. I'm almost certain everything is right.
I was checking the database.php in Pterodactyl and saw this Should this not be filled in?
32 Replies
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close
!close
!solved
!answered
Requested by nunyabizbro#0
I did not, it's a pre-installed OS image from PebbleHost
No,
env(...
pulls from environment variables, which can typically be found in the file /var/www/pterodactyl/.env
You shouldn't also be using these credentials for plugins / apps either, you should be using the panel to create a new database from the admin side of things, e.g.
You can then go back to the server once it has been created, and access the credentials you should be using by clicking the eye on the right:
Yeah I've been trying those however they're not working.
I've tried allowing all connections, changing passwords etc.
So for the top one, you're clicking the eye, copying the IP address/port + username&password it gives you, and you're using this in the plugin?
The 2nd one likely won't work, as your game server isn't at 127.0.0.1 due to docker
Correct. I've also tried putting the host in the plugin file 0.0.0.0, localhost, the actual ip to my server and 127.0.0.1
Let me make a dummy database and try to connect it, I'll show you what happens.
And just to sanity check, do those four things you've mentioned include the IP given from when you've clicked the eye? (I assume it's just your external IP, so yes?)
Correct.
So here are the settings
I have the mysql-host set to my external ip.
Save config and restarting, I'll screenshot the error.
👍
I assume it's probably going to be the firewall
This happens on multiple different plugins too despite how I configure it so I don't think it's plugin-sided.
This is for CoreProtect, but all plugins give a similar error.
oops hangon
So, access denied means that the database responded, but the user doesn't have the right perms
Are you sure the port is 3306?
Forgot to change the database name, one secon.
These are now the correct settings, let me restart
👌
so.
Please don't make fun of me, I have no clue what I did but they're working now.
That's what I like to hear 😄
I SWEAR I had the right info in there. I've been messing with this for hours.
It's all good, as long as it now works for you 🙂
Thanks for the help! 🙂
Any time
post closed!
The post/thread has been closed!
Requested by nunyabizbro#0