Solved

Local telnet 3306 not working but remote telnet is ok

Posted on 2009-04-15
15
881 Views
Last Modified: 2012-05-06
Hi all,

i'm setting up MySQL server on a new box. ive opened the port 3306 and i can do a remote telnet no probs. but when i do a local telnet to 3306 it fails to connect.

any ideas?
0
Comment
Question by:bede123
  • 7
  • 6
  • 2
15 Comments
 
LVL 3

Expert Comment

by:ealcaniz
Comment Utility
Do you have a firewall?
Use netstat -a to look if the port is open for all interfaces. The best is use wireshark or network trace to see what happens.
0
 
LVL 1

Author Comment

by:bede123
Comment Utility
i did netstat, can you help me understand what this is telling me?


Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>netstat -a

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    s15345860:echo         s15345860:0            LISTENING
  TCP    s15345860:discard      s15345860:0            LISTENING
  TCP    s15345860:daytime      s15345860:0            LISTENING
  TCP    s15345860:qotd         s15345860:0            LISTENING
  TCP    s15345860:chargen      s15345860:0            LISTENING
  TCP    s15345860:smtp         s15345860:0            LISTENING
  TCP    s15345860:http         s15345860:0            LISTENING
  TCP    s15345860:epmap        s15345860:0            LISTENING
  TCP    s15345860:microsoft-ds  s15345860:0            LISTENING
  TCP    s15345860:1025         s15345860:0            LISTENING
  TCP    s15345860:1030         s15345860:0            LISTENING
  TCP    s15345860:1036         s15345860:0            LISTENING
  TCP    s15345860:1037         s15345860:0            LISTENING
  TCP    s15345860:1038         s15345860:0            LISTENING
  TCP    s15345860:1052         s15345860:0            LISTENING
  TCP    s15345860:1056         s15345860:0            LISTENING
  TCP    s15345860:2522         s15345860:0            LISTENING
  TCP    s15345860:2616         s15345860:0            LISTENING
  TCP    s15345860:2930         s15345860:0            LISTENING
  TCP    s15345860:3306         s15345860:0            LISTENING
  TCP    s15345860:ms-wbt-server  s15345860:0            LISTENING
  TCP    s15345860:6085         s15345860:0            LISTENING
  TCP    s15345860:6086         s15345860:0            LISTENING
  TCP    s15345860:7999         s15345860:0            LISTENING
  TCP    s15345860:9921         s15345860:0            LISTENING
  TCP    s15345860:9951         s15345860:0            LISTENING
  TCP    s15345860:9961         s15345860:0            LISTENING
  TCP    s15345860:19997        s15345860:0            LISTENING
  TCP    s15345860:19998        s15345860:0            LISTENING
  TCP    s15345860:51800        s15345860:0            LISTENING
  TCP    s15345860:1044         s15345860:9951         ESTABLISHED
  TCP    s15345860:1942         s15345860:51800        CLOSE_WAIT
  TCP    s15345860:1948         s15345860:51800        CLOSE_WAIT
  TCP    s15345860:1976         s15345860:9961         TIME_WAIT
  TCP    s15345860:1977         s15345860:9921         TIME_WAIT
  TCP    s15345860:1978         s15345860:9961         TIME_WAIT
  TCP    s15345860:1979         s15345860:9921         TIME_WAIT
  TCP    s15345860:1980         s15345860:9961         TIME_WAIT
  TCP    s15345860:1981         s15345860:9921         TIME_WAIT
  TCP    s15345860:1982         s15345860:9961         TIME_WAIT
  TCP    s15345860:1983         s15345860:9921         TIME_WAIT
  TCP    s15345860:9951         s15345860:1044         ESTABLISHED
  TCP    s15345860:51800        s15345860:1942         FIN_WAIT_2
  TCP    s15345860:51800        s15345860:1948         FIN_WAIT_2
  TCP    s15345860:netbios-ssn  s15345860:0            LISTENING
  TCP    s15345860:1957         s15345860:2616         CLOSE_WAIT
  TCP    s15345860:1959         s15345860:2616         CLOSE_WAIT
  TCP    s15345860:2616         s15345860:1957         FIN_WAIT_2
  TCP    s15345860:2616         s15345860:1959         FIN_WAIT_2
  TCP    s15345860:ms-wbt-server  xx:35419  ESTABLISH
  UDP    s15345860:echo         *:*
  UDP    s15345860:discard      *:*
  UDP    s15345860:daytime      *:*
  UDP    s15345860:qotd         *:*
  UDP    s15345860:chargen      *:*
  UDP    s15345860:snmp         *:*
  UDP    s15345860:microsoft-ds  *:*
  UDP    s15345860:isakmp       *:*
  UDP    s15345860:1027         *:*
  UDP    s15345860:1029         *:*
  UDP    s15345860:1032         *:*
  UDP    s15345860:1034         *:*
  UDP    s15345860:ms-sql-m     *:*
  UDP    s15345860:1645         *:*
  UDP    s15345860:1646         *:*
  UDP    s15345860:radius       *:*
  UDP    s15345860:radacct      *:*
  UDP    s15345860:3456         *:*
  UDP    s15345860:ipsec-msft   *:*
  UDP    s15345860:ntp          *:*
  UDP    s15345860:1026         *:*
  UDP    s15345860:1028         *:*
  UDP    s15345860:1031         *:*
  UDP    s15345860:1033         *:*
  UDP    s15345860:1062         *:*
  UDP    s15345860:1063         *:*
  UDP    s15345860:1935         *:*
  UDP    s15345860:1952         *:*
  UDP    s15345860:3456         *:*
  UDP    s15345860:ntp          *:*
  UDP    s15345860:netbios-ns   *:*
  UDP    s15345860:netbios-dgm  *:*

C:\Documents and Settings\Administrator>
0
 
LVL 3

Expert Comment

by:ealcaniz
Comment Utility
ok only if you are listening for all the networks. But seems ok. Use a network monitor or wireshark to capture a network trace file.
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
so you saying

you can telnet remotely /: telnet ip_of_your_server 3306  : which works

but telnet localhost 3306 : does nto working

right ?

have you change the ip ( bind ip address ) of your my.cnf file ???
0
 
LVL 1

Author Comment

by:bede123
Comment Utility
yes that's correct.

bind ip address? no i havent alterned that. should i?

0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ok hold on

is this saying something like this

LHost 'localhost ' is not allowed to connect to this MySQL serverConnection closed by foreign host. ??

or its just unable to connect ???
0
 
LVL 1

Author Comment

by:bede123
Comment Utility
it says "could not open connection to the host on port.....

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
can you try by using the Ip address of your pc ??

telnet ip_of_this_pc 3306 ??
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
also check

netstat -an

past the ouput here, previoiusly the ouput you attached it does not show the IP
0
 
LVL 1

Author Comment

by:bede123
Comment Utility
doing telnet with the ip produces the same result.  here is the reult from netstat -an


C:\Documents and Settings\Administrator>netstat -an

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:7              0.0.0.0:0              LISTENING
  TCP    0.0.0.0:9              0.0.0.0:0              LISTENING
  TCP    0.0.0.0:13             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:17             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:19             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:25             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1025           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1030           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1036           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1037           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1038           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1052           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:1056           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2522           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2616           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2930           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:6085           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:6086           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:7999           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:9921           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:9951           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:9961           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:19997          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:19998          0.0.0.0:0              LISTENING
  TCP    0.0.0.0:51800          0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1044         127.0.0.1:9951         ESTABLISHED
  TCP    127.0.0.1:2420         127.0.0.1:9961         TIME_WAIT
  TCP    127.0.0.1:2421         127.0.0.1:9921         TIME_WAIT
  TCP    127.0.0.1:2422         127.0.0.1:9961         TIME_WAIT
  TCP    127.0.0.1:2423         127.0.0.1:9921         TIME_WAIT
  TCP    127.0.0.1:2424         127.0.0.1:9961         TIME_WAIT
  TCP    127.0.0.1:2425         127.0.0.1:9921         TIME_WAIT
  TCP    127.0.0.1:2426         127.0.0.1:9961         TIME_WAIT
  TCP    127.0.0.1:2427         127.0.0.1:9921         TIME_WAIT
  TCP    127.0.0.1:2428         127.0.0.1:9961         TIME_WAIT
  TCP    127.0.0.1:2429         127.0.0.1:9921         TIME_WAIT
  TCP    127.0.0.1:9951         127.0.0.1:1044         ESTABLISHED
  TCP    xx.xx.xx.xx:139      0.0.0.0:0              LISTENING
  TCP    xx.xx.xx.xx:3389     xx.xxx.xx.xx:36079   ESTABLISHED
  UDP    0.0.0.0:7              *:*
  UDP    0.0.0.0:9              *:*
  UDP    0.0.0.0:13             *:*
  UDP    0.0.0.0:17             *:*
  UDP    0.0.0.0:19             *:*
  UDP    0.0.0.0:161            *:*
  UDP    0.0.0.0:445            *:*
  UDP    0.0.0.0:500            *:*
  UDP    0.0.0.0:1027           *:*
  UDP    0.0.0.0:1029           *:*
  UDP    0.0.0.0:1032           *:*
  UDP    0.0.0.0:1034           *:*
  UDP    0.0.0.0:1434           *:*
  UDP    0.0.0.0:1645           *:*
  UDP    0.0.0.0:1646           *:*
  UDP    0.0.0.0:1812           *:*
  UDP    0.0.0.0:1813           *:*
  UDP    0.0.0.0:3456           *:*
  UDP    0.0.0.0:4500           *:*
  UDP    127.0.0.1:123          *:*
  UDP    127.0.0.1:1026         *:*
  UDP    127.0.0.1:1028         *:*
  UDP    127.0.0.1:1031         *:*
  UDP    127.0.0.1:1033         *:*
  UDP    127.0.0.1:1062         *:*
  UDP    127.0.0.1:1063         *:*
  UDP    127.0.0.1:3456         *:*
  UDP    217.160.xx.xx:123      *:*
  UDP    217.160.xx.xx:137      *:*
  UDP    217.160.xx.xx:138      *:*

C:\Documents and Settings\Administrator>
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
Ok

in mysql, have you give localhost to access mysql ???

i mean, does root has privilige on localhost ???
0
 
LVL 1

Author Comment

by:bede123
Comment Utility
does this answer your question?

if not please direct me. thanks
mysql-root.jpg
0
 
LVL 29

Accepted Solution

by:
fosiul01 earned 500 total points
Comment Utility
ok have you tryid to tellnet like ehtis

telnet 127.0.0.1 3306 ?

does it the same problem ??
0
 
LVL 1

Author Comment

by:bede123
Comment Utility
doh!

yes of course, that works . thanks very much
0
 
LVL 29

Expert Comment

by:fosiul01
Comment Utility
haha LOL

i realzied in my mysql server administration, its saying localhost

but your one its saying 127.0.0.1

it might you need to add localhost name in C:\WINDOWS\system32\drivers\etc\ host file ..
then try to do
telnet localhost 3306, its should work ...


0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now