New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
VPS for central database server
I have mostly vps's from RackNerd (4) and want to use just one of them for a dedicated database server based from lamp stack. That part is simple to install and get up running.
I want to be able to use this, from any of my other vps's, to connect and use the database.
Connection never works, even after making sure firewall is setup to allow, and correct ports are open.
Any suggestions where I can learn what I'm doing wrong, or if this is a provider problem?
Thanks in advance.
Thanked by 1pan_ia0_net
Comments
Is your database server listening on the public network interface, instead of 127.0.0.1 only?
Run
ss -an
to find out.Is your database user configured to have the IP address of the client machine?
For MySQL,
user1@localhost
and[email protected]
are different users.Please make sure you enable SSL (and enforce it for the users being used), and ideally use a VPN between the servers rather than just directly connecting over the internet. WireGuard works well for a point-to-point VPN like this.
What does this mean? Does the connection fail? Does it time out? Do you get an error message?
Error, can't connect
Good information, I'll look at this, thanks.
What's the exact error message?
Are you testing using the
mysql
CLI?Another user pwn3d by mariadb/mysql listening on 127.0.0.1 by default, but "hey, ports are open!".
Please listen to Daniel15 and use wireguard between servers (It's easy!) or at least make sure all your users (even built in, especially root) have password set.
For root it's usually a good idea to use unix_socket authentication which means you have to be logged in to the server as root (or using
sudo
) to connect. Of course, this means you can't connect as root over the network, but that's really not a good idea anyways