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

Issues changing sql servers

Tracy Perry

Well-known member
#3
The below paste is the server ever I get. We swapped SQL servers for one of our plugins and i'm 100% sure the information is correct. Anyone have a clue?
http://pastie.org/private/rgfxugv6mz75pvxkgavha
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.
 

Kainzo

Active member
#4
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.
Pretty sure it is opened
AcceptIf protocol is TCP and destination port is 3306
 

Floren

Well-known member
#5
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:
Code:
# 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).
 

jwright

Active member
#6
On the server that's running MySQL, run the following command:

Code:
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 :)
 

Kainzo

Active member
#8
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 (127.0.0.1) to 0.0.0.0 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)
http://pastie.org/private/0kec67edsyc2nhyfshiojg

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

Code:
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 :)
Sorry for the late reply - I'm attempting to run that cmd now. It is taking quite sometime.
Looks like nothing came back.

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:
Code:
# 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).
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!
 
#11
Giving that a go. Maybe I forgot I did this in the past.

GRANT ALL PRIVILEGES ON *.* TO USER@IP IDENTIFIED BY PASS;

I did that - lets see if it works :D thanks!
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.