Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cant connect to MYSQL server out of the machine... [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
lpx
Apprentice
Apprentice


Joined: 03 Mar 2005
Posts: 205
Location: Braga, Portugal

PostPosted: Sat Apr 01, 2006 5:08 pm    Post subject: Cant connect to MYSQL server out of the machine... [SOLVED] Reply with quote

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
View user's profile Send private message
kamikaze04
Guru
Guru


Joined: 28 Mar 2004
Posts: 366
Location: Valencia-Spain

PostPosted: Sat Apr 01, 2006 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ateo
Advocate
Advocate


Joined: 02 Jun 2003
Posts: 2022
Location: Vegas Baby!

PostPosted: Sat Apr 01, 2006 6:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
lpx
Apprentice
Apprentice


Joined: 03 Mar 2005
Posts: 205
Location: Braga, Portugal

PostPosted: Sat Apr 01, 2006 7:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
kg
n00b
n00b


Joined: 17 May 2003
Posts: 55
Location: Not where I want to be

PostPosted: Sun Apr 02, 2006 2:21 pm    Post subject: Reply with quote

By default (at least on mine :wink: ), 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 :D

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
View user's profile Send private message
lpx
Apprentice
Apprentice


Joined: 03 Mar 2005
Posts: 205
Location: Braga, Portugal

PostPosted: Sun Apr 02, 2006 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
kg
n00b
n00b


Joined: 17 May 2003
Posts: 55
Location: Not where I want to be

PostPosted: Sun Apr 02, 2006 3:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Joe Kinley
n00b
n00b


Joined: 31 May 2003
Posts: 74
Location: Germany

PostPosted: Fri Apr 14, 2006 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message
DaveArb
Guru
Guru


Joined: 29 Apr 2004
Posts: 510
Location: Texas, USA

PostPosted: Fri Apr 14, 2006 1:24 pm    Post subject: Reply with quote

Joe Kinley wrote:
Can i aply multiple bind-address variables in there ?


Yes, just list them on successive lines.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum