Help - Search - Members - Calendar
Full Version: Enable MySQL connections between 2 servers
The Planet Forums > System Administration > HOWTOs
Dennison
Hi there we're getting a couple of servers added within our private rack and we wanted to interface in a way such that one would end up being a dedicated db (MySQL) server while the other would connect to it as a dedicated web server.

Could anyone point us a detailed resource that can help us enable MySQL connections between these two machines? We're have CPanel running on both machines. Any advice would be appreciated. Thanks!
Dennison
Hi anyone able to help with this? wacko.gif
James Jhurani
Rather than posting it twice...

http://forums.theplanet.com/index.php?show...c=87404&hl=
Glen Lumanau
If you have WHM installed, You need to go under the
CODE
WHM Manager >> SQL Services >> Setup Remote MySQL server.


Hope this's what you want
Dennison
QUOTE (Glen Lumanau @ Jun 11 2007, 02:42 AM) *
If you have WHM installed, You need to go under the
CODE
WHM Manager >> SQL Services >> Setup Remote MySQL server.


Hope this's what you want


Thanks for the responses! Already tried that method but I get this error when I try connecting from my web server to the remote db server assigned from the mysql command line:

"ERROR 1130 (00000): Host 'x.x.x.x is not allowed to connect to this MySQL server"

Wherein x.x.x.x isn't even the correct IP of the web server.. strange
James Jhurani
you need to make a grant statement on the mysqld server with the other servers ip...

eg: 1.1.1.1 == mysqld server
2.2.2.2 == the server trying to connect.

on 1.1.1.1 you need to do:
GRANT ALL PRIVILEGES ON test.* TO 'user'@'2.2.2.2' IDENTIFIED BY 'some_password';

obviously you will need to tailor that a bit.
Aaron Moon
QUOTE (jjhurani @ Jun 12 2007, 09:13 AM) *
you need to make a grant statement on the mysqld server with the other servers ip...

eg: 1.1.1.1 == mysqld server
2.2.2.2 == the server trying to connect.

on 1.1.1.1 you need to do:
GRANT ALL PRIVILEGES ON test.* TO 'user'@'2.2.2.2' IDENTIFIED BY 'some_password';

obviously you will need to tailor that a bit.


Have you thought about enabling bin-logging? this would take one database and turn it into a master, and any others a slave, this is basically database replication. Each database writes to a log file, and each slave is configured to read the log file and keep track of position so if one server goes down when it wakes up it knows where it's left off, and picks right up and cathes the data up.

let me know if you need help with this as i have done this several times with great success even with servers located in other countries.

The beauty is that you dont need WHM or CPANLE you can run this via command line, and will work with just about any linux server running redhat, debian, suse, with cpanel mysql etc.....
Dennison
QUOTE (jjhurani @ Jun 12 2007, 09:13 AM) *
you need to make a grant statement on the mysqld server with the other servers ip...

eg: 1.1.1.1 == mysqld server
2.2.2.2 == the server trying to connect.

on 1.1.1.1 you need to do:
GRANT ALL PRIVILEGES ON test.* TO 'user'@'2.2.2.2' IDENTIFIED BY 'some_password';

obviously you will need to tailor that a bit.


We've finally been able to get this to work. Seems like the IP identifying the connecting (web) server is different from the IP that we thought is assigned to it. Anyway the error message managed to clue us in on this and when we granted privilege to the IP shown, it started working fine. Might have been an effect on everything being in a single private rack.

Anyway Thanks to all for helping!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.