Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


VPS for central database server
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.

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

  • yoursunnyyoursunny Member, IPv6 Advocate

    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.

    Thanked by 1pan_ia0_net
  • 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.

    Connection never works

    What does this mean? Does the connection fail? Does it time out? Do you get an error message?

    Thanked by 1pan_ia0_net
  • @Daniel15 said:
    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.

    Connection never works

    What does this mean? Does the connection fail? Does it time out? Do you get an error message?

    Error, can't connect

    Thanked by 1pan_ia0_net
  • @yoursunny said:
    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.

    Good information, I'll look at this, thanks.

    Thanked by 1pan_ia0_net
  • @melp57 said: Error, can't connect

    What's the exact error message?

    Are you testing using the mysql CLI?

    Thanked by 2melp57 pan_ia0_net
  • JabJabJabJab Member
    edited February 2022

    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.

    Thanked by 2melp57 pan_ia0_net
  • @JabJab said: 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 :smile:

    Thanked by 1ariq01
Sign In or Register to comment.