Go Back   Forum Care Forums > Development Reference Area > MySQL Discussion

Reply
 
LinkBack Thread Tools Display Modes
mysql and remote access...
Old
  (#1)
Rob
Guest
 
Posts: n/a
Default mysql and remote access... - 06-04-2007, 07:50 AM

Hi all,
newbier in mysql...
I have mysql-server-5.0 on debian/testing on a server at home,
and cannot connect to it from the internet.

I did enable port forwarding and firewal traffic for tcp 3306
(this is the port specified in /etc/mysql/my.conf).

Situation:

- I CAN connect from localhost with "mysql -u root -p"
- I CANNOT connect from the internet and mysql-admin
( I get:
>Could not connect to host 'xxx.xxx.xxx.xxx'.
>MySQL Error Nr. 2003
>Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)

)
- from localhost I CAN get a response from:
telnet localhost 3306
- from the internet I CANNOT get a response from:
telnet xxx.xxx.xxx.xxx 3306 ( I get connection refused)


Any idea ?

Thenks
Roberto

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: mysql and remote access...
Old
  (#2)
Robert Klemme
Guest
 
Posts: n/a
Default Re: mysql and remote access... - 06-04-2007, 07:50 AM

On 22.01.2007 13:18, Rob wrote:
> Hi all,
> newbier in mysql...
> I have mysql-server-5.0 on debian/testing on a server at home,
> and cannot connect to it from the internet.
>
> I did enable port forwarding and firewal traffic for tcp 3306
> (this is the port specified in /etc/mysql/my.conf).
>
> Situation:
>
> - I CAN connect from localhost with "mysql -u root -p"
> - I CANNOT connect from the internet and mysql-admin
> ( I get:
> >Could not connect to host 'xxx.xxx.xxx.xxx'.
> >MySQL Error Nr. 2003
> >Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)

> )
> - from localhost I CAN get a response from:
> telnet localhost 3306
> - from the internet I CANNOT get a response from:
> telnet xxx.xxx.xxx.xxx 3306 ( I get connection refused)
>
>
> Any idea ?


You have likely bound MySQL only to 127.0.0.1 and not to x.x.x.x - did
you try to connect to x.x.x.x:3306 on the local machine?

Look into /etc/mysql/my.cnf - you'll likely find a line

bind-address = 127.0.0.1

Either change or uncomment that. You may have to restart MySQL to make
the change effective.

robert
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: mysql and remote access...
Old
  (#3)
Rob
Guest
 
Posts: n/a
Default Re: mysql and remote access... - 06-04-2007, 07:50 AM

Thanks, Robert

-Robert Klemme ha scritto:

>
> You have likely bound MySQL only to 127.0.0.1 and not to x.x.x.x - did
> you try to connect to x.x.x.x:3306 on the local machine?
>
> Look into /etc/mysql/my.cnf - you'll likely find a line
>
> bind-address = 127.0.0.1
>
> Either change or uncomment that. You may have to restart MySQL to make
> the change effective.


You right!...but I need an additional step, I guess...

I tried: mysql -h 10.0.0.5 -u root -p
and got:
ERROR 2003 (HY000): Can't connect to MySQL server on '10.0.0.5'
(111)

So I added an additional line (the local LAN address of my server):
bind-address = 10.0.0.5

Now I get a different error (the same from internet):
$ mysql -h 10.0.0.5 -u root -p
ERROR 1130 (00000): Host '10.0.0.5' is not allowed to connect to this
MySQL server

I suspect I have to "allow" desired hosts somewhere, but I didn't find
suitable
hints from my.cnf syntax...
Do you have a final idea?

Thank you very much in advance

Roberto

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: mysql and remote access...
Old
  (#4)
...fl
Guest
 
Posts: n/a
Default Re: mysql and remote access... - 06-04-2007, 07:53 AM


"Rob" <EMAIL REMOVED> ha scritto nel messaggio
news:EMAIL REMOVED ups.com...
> Hi all,
> newbier in mysql...
> I have mysql-server-5.0 on debian/testing on a server at home,
> and cannot connect to it from the internet.
>
> I did enable port forwarding and firewal traffic for tcp 3306
> (this is the port specified in /etc/mysql/my.conf).
>
> Situation:
>
> - I CAN connect from localhost with "mysql -u root -p"
> - I CANNOT connect from the internet and mysql-admin
> ( I get:
> >Could not connect to host 'xxx.xxx.xxx.xxx'.
> >MySQL Error Nr. 2003
> >Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (111)

> )
> - from localhost I CAN get a response from:
> telnet localhost 3306
> - from the internet I CANNOT get a response from:
> telnet xxx.xxx.xxx.xxx 3306 ( I get connection refused)
>
>
> Any idea ?
>
> Thenks
> Roberto
>

.... sorry for my english
it is possible because the security previews this rule,
now you have to put 1 new customer with appropriate rights appropriate,
and new possibility for login remote access.
you see the handbook.
bye.


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top