1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Issues changing sql servers

Discussion in 'Server Configuration and Hosting' started by Kainzo, Nov 23, 2013.

  1. Kainzo

    Kainzo Active Member

  2. W1zzard

    W1zzard Well-Known Member

    Do you have a firewall blocking traffic?

    telnet realm.hc.to 3306

    on the webserver shell can connect?
  3. Tracy Perry

    Tracy Perry Well-Known Member

    As @W1zzard stated.. if the SQL server is on another physical server, be sure that the port for it is opened and connection is allowed from the server that is trying to connect (I wouldn't leave it open for the whole world but restrict it to the IP you are connecting from).
    If it is on the same server, then it should be working.
  4. Kainzo

    Kainzo Active Member

    Pretty sure it is opened
    AcceptIf protocol is TCP and destination port is 3306
  5. Floren

    Floren Well-Known Member

    Is simple to verify if you can connect to a remote MySQL server, use PHP mysqli_connect function.
    I'm sure is something small related to IP or user credentials. As other users stated, check if MySQL port is open in iptables also. On remote server, run:
    # service iptables status | grep 330
    If you have nothing returned, then your port is not open. I grepped 330 because I run 2 ports for MySQL 3306 and 3307 (in case someone hacks me and I want a backdoor).
  6. jwright

    jwright Active Member

    On the server that's running MySQL, run the following command:

    lsof -i |grep 3306
    This will tell us if MySQL is configured to listen on port 3306 to start with. The firewall is irrelevant if MySQL isn't listening on the port :)
  7. HittingSmoke

    HittingSmoke Active Member

    Can you clarify what you mean by "swapped" SQL servers?
  8. Kainzo

    Kainzo Active Member

    Since I can't edit the first post - I'm going to explain indepth here.

    We run a XF addon to pull a SQL database query from our minecraft server. So "site" is pulling from "box". We bought a new machine and moved the minecraft data to "realm". This broke the addon, obviously because the names/ip's were different. We're now running MariaDB (upgraded from MySQL 5.5). I moved the my.cnf file to point from local ( to for external. It's still having issues. I have verified that all IPtables are set up correctly and the move from the "box" machine to "realm" machine cloned the iptables.

    Below is the latest error message (may be different from the above)

    Sorry for the late reply - I'm attempting to run that cmd now. It is taking quite sometime.
    Looks like nothing came back.

    minecraft@realm:~$ service iptables status | grep 330
    iptables: unrecognized service
    minecraft@realm:~$ service iptables status | grep 3306
    iptables: unrecognized service
    Strange thing is, I can connect using phpmyadmin and there's nothing actively blocking.

    Thanks for all the help!
  9. MattW

    MattW Well-Known Member

  10. Kainzo

    Kainzo Active Member

    Giving that a go. Maybe I forgot I did this in the past.


    I did that - lets see if it works :D thanks!
  11. HittingSmoke

    HittingSmoke Active Member

    One thing to add. If the XenForo addon connecting to the database doesn't NEED all privileges, don't grant them. You're opening yourself up a huge security hole there. Find out what permissions it absolutely needs and create a new user specifically for that.
  12. Floren

    Floren Well-Known Member

    You need to run it as root, not as unprivileged user.

Share This Page