File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Mysql server connection error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Mysql server connection error" Watch "Mysql server connection error" New topic

Mysql server connection error

sean zang
Ranch Hand

Joined: Apr 22, 2000
Posts: 33
Hi, all
I try to connect Mysql server with localhost, It gives me following error:
ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)
I install Shareware Mysql on Nt server, and start it as followings:
1:mysqlshareware (no problem)
2: net start mysql(casue below error)
The service name is invalid.
More help is available by typing NET HELPMSG 2185.
I try to use mysqlmanger to config host ip and port number, but the problem still exsits!
Does anyone point out what's wrong with mysql configuration
thanks in advance

Luther Adon
Ranch Hand

Joined: Apr 27, 2002
Posts: 51
Well, it's 2 years later and I am having the exact same error. Funny, I hear mysql is the easiest database going and I've wasted a week here. I have got going DB2, Access, and McKoi successfully. Anyone have the answer?
P.S. I really don't appreciate my last post for this problem being deleted, if it was posted in the wrong place it could have been moved or I could have been notified. So much for Java Ranch being a friendly place.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

I think there have probably been some major changes to mySQL in the past 2 years. Have you downloaded the most recent stable version? I know that the way to start the mySQL server now is
mysqld --port=port#
And that will start the mysql daemon. The error you were getting sounds like the client couldn't find the server, which means the server wasn't running, or at the time of that MySQL version, there were some other options you needed to specify, such as port, login, etc.

GenRocket - Experts at Building Test Data
Luther Adon
Ranch Hand

Joined: Apr 27, 2002
Posts: 51
Thanks for your response.
I definitely have the most stable release. I am just debugging it now and mysql seems to work fine on my win98 computer. So I think it may be some kinda porting issue. I am trying to get it running on my laptop which has windows nt server. On start up of the laptop it generates an error or two I assume as it expects there to be computers connected to it. Maybe it is the windows errors causing porting problems?
Jeremy Maddera

Joined: May 02, 2002
Posts: 16
have you tried starting MySql from the command line.
C:/mysql/bin/mysqld-nt.exe --console --standalone
this will start a command process where you can see the MySql output..Also tells MySql not to start as a service....
Luther Adon
Ranch Hand

Joined: Apr 27, 2002
Posts: 51
I finally tracked down the problem and thought I'd share it as nowhere on the Internet could I find a fix. This is a problem with your OS, not mysql. Check to see if your localhost is ok, if it is not you may need to reinstall your OS so that the localhost works, I also bought a USB network adapter as I was told it would be needed by a hardware/OS specialist friend.
[ September 17, 2002: Message edited by: Luther Adon ]
I agree. Here's the link:
subject: Mysql server connection error
It's not a secret anymore!