The moose likes JDBC and Relational Databases and the fly likes MySQL localhost Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

MySQL localhost

Sathya Krish

Joined: Aug 20, 2009
Posts: 8
when I run mysql it displays the following error

ERROR 2003 <HY000): Can't connect to MySQL server on 'localhost' <10061>

from where can I can get this localhost

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2904

localhost is your local machine and MySQl server instance by default runs on port 3306, so checkout if that port is opened and any service is running on it. Use netstat command from command prompt to check any process running on port 3306.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
James Ward
Ranch Hand

Joined: Apr 27, 2003
Posts: 263
Also check this out, it talks about such problems:
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Indeed, most likely you don't have MySQL running on your machine.
Does it work if you replace localhost by in your connect string?

Note that mysql is not the way to start MySQL.
mysql is a query tool, not a database startup tool.


Regards, Jan

OCUP UML fundamental and ITIL foundation
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hello All,

I'm trying to install MySQL on my laptop.

When I installed it successfully, my code didn't show the desired answer.
so I removed and reinstalled MySQL and since then, even if I enter correct existing password followed by new password and confirm it.
It shows me Error no 2003, "Can't connect to MySQL server on localhost(10061).
I checked the process MySQL, but it stops within a moment after starting through control panel.

when I do the same through command prompt by giving sc qc MySQL, it shows me access denied when I'm the admin of the machine.

Please help.

Unfortunately I'm unable to attache word file here ...

Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Hi pramod .
Please create a separate post for your problem.

edit: typo
I agree. Here's the link:
subject: MySQL localhost
It's not a secret anymore!