aspose file tools
The moose likes JDBC and the fly likes MySQL localhost Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
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: 2896
    
    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: 2343

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
ITIL foundation
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

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: 2343

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


edit: typo
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: MySQL localhost
 
Similar Threads
Problem in Java Connection with MySQL in Linux Mandriva.
Problem while configuring mysql
Access denied phpMyAdmin
MySql 5.1.48 GRANT problems
Null pointer exception in con.createStatement();