View previous topic :: View next topic |
Author |
Message |
lpx Apprentice
Joined: 03 Mar 2005 Posts: 205 Location: Braga, Portugal
|
Posted: Sat Apr 01, 2006 5:08 pm Post subject: Cant connect to MYSQL server out of the machine... [SOLVED] |
|
|
Hi everyone,
Can anybody tell me why cant i connect to my mysql server running on a machine from another machine on my network?
I created a user already but the connection is refused.
Any lights?
Many thx _________________ Imaginando o futuro
Imagining the future
Last edited by lpx on Sun Apr 02, 2006 2:25 pm; edited 1 time in total |
|
Back to top |
|
|
kamikaze04 Guru
Joined: 28 Mar 2004 Posts: 366 Location: Valencia-Spain
|
Posted: Sat Apr 01, 2006 5:46 pm Post subject: |
|
|
Uncomment bind-address = 127.0.0.1 in your /etc/mysql/my.cnf _________________ Todo lo que quisiste saber sobre google en: www.noticiasgoogle.es |
|
Back to top |
|
|
Ateo Advocate
Joined: 02 Jun 2003 Posts: 2022 Location: Vegas Baby!
|
Posted: Sat Apr 01, 2006 6:36 pm Post subject: |
|
|
kamikaze04 wrote: | Uncomment bind-address = 127.0.0.1 in your /etc/mysql/my.cnf |
This will not work if trying to connect from another node on the local network...
Change bind-address to the IP address of the machine that runs MySQL... restart MySQL.. |
|
Back to top |
|
|
lpx Apprentice
Joined: 03 Mar 2005 Posts: 205 Location: Braga, Portugal
|
Posted: Sat Apr 01, 2006 7:37 pm Post subject: |
|
|
Hi,
Thx guys!
It worked. Can someone just explain me what it means?
I didnt understand that.
Many thx _________________ Imaginando o futuro
Imagining the future |
|
Back to top |
|
|
kg n00b
Joined: 17 May 2003 Posts: 55 Location: Not where I want to be
|
Posted: Sun Apr 02, 2006 2:21 pm Post subject: |
|
|
By default (at least on mine ), mysql only listens on the loopback address 127.0.0.1
which can only be accessed from the machine on which you are running mysql.
Code: | bind-address = 127.0.0.1
|
This is what tells mysql where to listen. If you want to have it listen for connections
from your local network, you need to tell it to listen to the local network
That is why Ateo told you to change this line to your IP address and restart mysql. _________________ If at first you don't succeed, try again. Then quit. No use being a damn fool about it. --W.C. Fields |
|
Back to top |
|
|
lpx Apprentice
Joined: 03 Mar 2005 Posts: 205 Location: Braga, Portugal
|
Posted: Sun Apr 02, 2006 2:26 pm Post subject: |
|
|
Thx for the explanation.
So. If i want to connect from the internet i need to put localhost, right?
Many thx, _________________ Imaginando o futuro
Imagining the future |
|
Back to top |
|
|
kg n00b
Joined: 17 May 2003 Posts: 55 Location: Not where I want to be
|
Posted: Sun Apr 02, 2006 3:49 pm Post subject: |
|
|
Not quite.
localhost means only the local host. Setting the bind address to your IP address means it will
listen for network connections--from both your LAN and the Internet. (Assuming that your firewall/router
is configured to allow access from the Internet. mysql listens on port 3306 by default.) _________________ If at first you don't succeed, try again. Then quit. No use being a damn fool about it. --W.C. Fields |
|
Back to top |
|
|
Joe Kinley n00b
Joined: 31 May 2003 Posts: 74 Location: Germany
|
Posted: Fri Apr 14, 2006 11:54 am Post subject: |
|
|
What if i got two nics ... one that connects to the internet and another that connects to the inner network
Can i aply multiple bind-address variables in there ? _________________ No matter what, always follow your heart |
|
Back to top |
|
|
DaveArb Guru
Joined: 29 Apr 2004 Posts: 510 Location: Texas, USA
|
Posted: Fri Apr 14, 2006 1:24 pm Post subject: |
|
|
Joe Kinley wrote: | Can i aply multiple bind-address variables in there ? |
Yes, just list them on successive lines. |
|
Back to top |
|
|
|