MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 13th, 2003, 06:18 AM
brettm brettm is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 6 brettm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question HELP! Can't connect to MySQL server on localhost (10061)

Before you bag me too much ... I have been searching for a fix to this problem for a week or so in this forum, in the MySQL doc and anywhere that remotely looked like it had a solution.

I am running MySQL 3.23.57-nt on Windows XP Pro and have struggled to get it working with anything other phpMyAdmin, which appears to be the only app that can connect to the server port.

I am also running apache web server on the same machine.

My current my.ini file looks like ...
#This File was made using the WinMySQLAdmin 1.4 Tool
#13/07/2003 8:31:03 PM

#Uncomment or Add only the keys that you know how works.
#Read the MySQL Manual for instructions

[mysqld]
basedir=D:/mysql
#bind-address=10.0.0.1
datadir=D:/mysql/data
#language=D:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=D:/mysql/bin/mysqld-nt.exe
user=root
password=<password>

The troubleshooting I have gone through so far is: -
1. Checked the hosts file to ensure there were no conflicts. I have removed everything except localhost (127.0.0.1).
2. telnet localhost 3306 - works OK.
3. phpMyAdmin works OK.
4. set the root password and tried (I don't know why I did this but I thought the no password option was causing some error :confused
5. Removed MySQL 4.x and re-installed 3.23
6. Checked that a firewall was not running on XP and it wasn't
7. Removed my.ini so that winMySqlAdmin would re-create it - worked OK.
8. Removed every entry in the my.ini except datadir, basedir and user.
9. scratched my head a lot.
10. cursed.
11. Tried connect with mysqladmin but get the same error
12. started mysqld in standalone mode and connecting that way forgive me if this is a bit stupid, I am new at MySQL).
13. Changed the mysqld program to "run as" my user rather than system (read this somewhere as a possible fix) ... no good.
14. setup a new user for access only from localhost (also read that this was needed but no good.
15. I have also tried telnet to port 3306 when MySQL is not running just in case something else is grabbing the port. It failed with a connection refused message as expected.

So after all that I am at a loss.

I would really love to get this working as I want to try some OLAP stuff using MySQL.

Any help would be greatly appreciated.

brettm

Reply With Quote
  #2  
Old July 13th, 2003, 08:36 AM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 6
Quote:
I am running MySQL 3.23.57-nt on Windows XP Pro and have struggled to get it working with anything other phpMyAdmin, which appears to be the only app that can connect to the server port.


Please check following:
[1]
What kinds of application you are is trying to connect to MySQL server?
Do you need to install ODBC?
If yes, install it and check once again your connection string.

[2]
If you connect with the internet trough a gateway. If your DNS is enabled. After disableing DNS, try again to connect to MySQL server.

Reply With Quote
  #3  
Old July 13th, 2003, 03:56 PM
brettm brettm is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 6 brettm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the quick response ...

I am trying to connect to the DB using MySQL Control Center and other various management tools as I am just trying to set up my DB. I have also installed the ODBC driver and received exactly the same error.

Further, I wrote a small test Java/JDBC program and received the same error.

I will check the DNS and report back. Sorry cannot do it now ... got to go to work

Thanks.

Reply With Quote
  #4  
Old July 14th, 2003, 07:05 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Brett,

Are you using MySQL solely for Java purposes? If so, have you installed wConnector/J?

Check that link if you haven't already done so...
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #5  
Old July 21st, 2003, 05:59 AM
brettm brettm is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 6 brettm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry Still no luck

Tried Connector/J already but re-installed anyway. Got the following ...

C:\JBuilder8\jdk1.4\bin\javaw -classpath "C:\Documents and Settings\brett\jbproject\t_golfer1\classes;D:\java \jre\lib\ext\mysql-connector-java-3.0.8-stable-bin.jar;C:\JBuilder8\jdk1.4\demo\jfc\Java2D\Java2D emo.jar;C:\JBuilder8\jdk1.4\demo\plugin\jfc\Java2D \Java2Demo.jar;C:\JBuilder8\jdk1.4\jre\lib\charset s.jar;C:\JBuilder8\jdk1.4\jre\lib\ext\dnsns.jar;C: \JBuilder8\jdk1.4\jre\lib\ext\ldapsec.jar;C:\JBuil der8\jdk1.4\jre\lib\ext\localedata.jar;C:\JBuilder 8\jdk1.4\jre\lib\ext\sunjce_provider.jar;C:\JBuild er8\jdk1.4\jre\lib\im\indicim.jar;C:\JBuilder8\jdk 1.4\jre\lib\jaws.jar;C:\JBuilder8\jdk1.4\jre\lib\j ce.jar;C:\JBuilder8\jdk1.4\jre\lib\jsse.jar;C:\JBu ilder8\jdk1.4\jre\lib\rt.jar;C:\JBuilder8\jdk1.4\j re\lib\sunrsasign.jar;C:\JBuilder8\jdk1.4\lib\dt.j ar;C:\JBuilder8\jdk1.4\lib\htmlconverter.jar;C:\JB uilder8\jdk1.4\lib\tools.jar" t_golfer1.t_golfer1
java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.ConnectException: Connection refused: connect

at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1622)

at com.mysql.jdbc.Connection.<init>(Connection.java:491)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:346)

at java.sql.DriverManager.getConnection(DriverManager .java:512)

at java.sql.DriverManager.getConnection(DriverManager .java:193)

at t_golfer1.t_golfer1.main(t_golfer1.java:12)

Exception in thread "main"

Thanks for your help!

Reply With Quote
  #6  
Old July 21st, 2003, 06:02 AM
brettm brettm is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 6 brettm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Why can I connect with PHPMyAdmin?

What is so different about PHPMyAdmin? It can connect and has always been able to.

I would appreciate any further suggestions!

Reply With Quote
  #7  
Old July 23rd, 2003, 09:06 AM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
phpMyAdmin connects with the php mysql function mysql_connect(); using the information you specified in your config.inc.php file. Have you tried to connect from the command line? mysql -u username -p -h localhost
If you're running windows 2k or xp, do you have the firewall running? Have you verified that port 3306 is even open for connections?

Reply With Quote
  #8  
Old July 26th, 2003, 08:23 PM
brettm brettm is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 6 brettm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes, I have checked that the port is open. In my initial message I stated that I had telnet'ed successfully to the port. No, there is no firewall running.

My question was not about the config of PHP connecting to the MySQL db but the method it used, i.e., emulated telnet, pure sockets, how??? The reason I asked the question was because it is the only app that connect to the db.

As for "mysql -u username -p -h localhost", this returned the same error.

I would appreciate any other feedback.

Many thanks.

brettm

Reply With Quote
  #9  
Old July 28th, 2003, 07:18 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Could it have anything to do with the fact that your bind-address is listed as 10.0.0.1 and localhost is the standard 127.0.0.1? This may be standard procedure, but it seems to me that it could cause some sort of conflict. Try mysql -u username -p -h 10.0.0.1 for kicks. Then check to see if phpMyAdmin is using 10.0.0.1 or localhost or 127.0.0.1. Telnetting to 3306 on localhost tells you that the port is open but says nothing about the state of mysql (unless you got a prompt of some sort). This is certainly perplexing.

Reply With Quote
  #10  
Old August 2nd, 2003, 02:22 AM
brettm brettm is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Melbourne Australia
Posts: 6 brettm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
When I telnet localhost 3306 I get the following ...

1
4.0.14-max-debug^I2_fdC

►☺♦Bad handshake

Connection to host lost.

The bad handshake only comes after hitting enter twice. However if I telnet to 10.0.0.1 (same port) I do not get the connection message nor the bad handshake message.

PHPMyAdmin is using localhost to connect.

I have installed MySQL 4.0.14a just to see if this made a difference. I unstalled 3.23 and installed the new version in a different directory (and disk) but I still get the same error.

Any other suggestions would be greatly appreciated.

Thanks.

brettm

Reply With Quote
  #11  
Old August 4th, 2003, 07:29 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Quote:
The bad handshake only comes after hitting enter twice. However if I telnet to 10.0.0.1 (same port) I do not get the connection message nor the bad handshake message.


Yeah, this is because you start the connection, but the server's waiting for input before it sends anything back to you. Same thing happens if you telnet to port 80. It just sits there until you type "GET," at which point it spits out the default page.

Have you tried any other PHP apps? I suspect they'd probably work. The only thing I can recommend is that you sniff around php.net or try to find something about the internal methods PHP uses to connect. I'm not sure even that'll wind up being very helpful. I wish I had something more helpful to contribute.

Reply With Quote
  #12  
Old December 2nd, 2003, 07:06 PM
wardenaar wardenaar is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 wardenaar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I had the same problem as you have.
Because I have a ADSL-connection with my provider, the DNS-lookup goes via the provider. This confuses MySQL (localhost cannot be found by it anymore.)

The solution could be :

enable-named-pipe

in the my.ini file. It worked for me......

a sample my.ini file :

[mysqld]
basedir=C:/mysql
enable-named-pipe
datadir=C:/mysql/data
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
QueryInterval=10

Reply With Quote
  #13  
Old March 16th, 2004, 10:05 AM
ALEXX ALEXX is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 1 ALEXX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool shiie

Quote:
Originally Posted by brettm
Tried Connector/J already but re-installed anyway. Got the following ...


at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:346)

at java.sql.DriverManager.getConnection(DriverManager .java:512)

at java.sql.DriverManager.getConnection(DriverManager .java:193)

at t_golfer1.t_golfer1.main(t_golfer1.java:12)

Exception in thread "main"

Thanks for your help!

Hi

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > HELP! Can't connect to MySQL server on localhost (10061)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |