File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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
Reply locked New topic
Author

MySQL localhost

Sathya Krish
Greenhorn

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

c:\Sun\AppServer\mysql\bin>mysql
ERROR 2003 <HY000): Can't connect to MySQL server on 'localhost' <10061>

from where can I can get this localhost

thanks
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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:

http://qnatech.wordpress.com/category/mysql/
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

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

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

Info: http://dev.mysql.com/doc/refman/5.0/en/windows-start-command-line.html

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
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 ...


Thanks,
Pramod
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

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


edit: typo
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MySQL localhost