Bug #20238 Can't connect to MySQL server on 'localhost' (10061)"
Submitted: 2 Jun 2006 21:42 Modified: 27 Jun 2006 17:48
Reporter: Liu xuanyu Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.21 OS:Microsoft Windows (Win2003)
Assigned to: CPU Architecture:Any

[2 Jun 2006 21:42] Liu xuanyu
Description:
I am often find the same quetions from mysql5.0.* version. Now I am
using windows 2003 and mysql 5.0.21. when restart windows system, then
mysql cant   connect."  Can't connect to MySQL server on 'localhost'
(10061)" .

but I am saw mysql service started run. 

So I have try use dos command E:\MySQL5\bin\mysqld --console. and see
some informations. and just mysql can work . but I close the dos
command window after, mysql down and cant work again.

please see the photo. 

The questions have been many times and ask for friends help. but mysql
still happen the wrong. 

This is my use --console command after mysql will work. but when i 
close
the command mysql still cant right work.  Using Mysql 5.0.21 

Plese tell me how i do it. ?!  

Thanks

--Liu.

How to repeat:
info_yon at yahoo.com.cn
[2 Jun 2006 22:25] Miguel Solorzano
Thank you for the bug report. Sorry but this isn't bug, try the below steps:

1- Be sure using the Task manager none mysqld process is running as service.
2- Open a DOS prompt and go the install \bin directory.
3- Run the below command:

   mysqld-nt --standalone --console
4- Open another DOS prompt and go too to the \bin directory.
5- Run the below command:

   mysql -uroot -p

you will see something like below:

c:\mysql\bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 5.0.22

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

You need to provide a password if you during the install had configured
the root privileges or empty otherwise.
[3 Jun 2006 10:34] Liu xuanyu
Sir .

  Hello, I already deferred to your explanation to do.  But has done this solves the problem? Under how continuation step? 

The original question is after the system restarts,MYSQL on frequently cannot the normal work. What can you tell the question reason are? !

Thanks 

-- Liu.
[3 Jun 2006 10:46] Liu xuanyu
I have do its.

E:\MySQL5\bin>mysqld-nt --standalone --console
060603 18:16:33 [Warning] Changed limits: max_open_files: 2048  max_connections:
 800  table_cache: 619
060603 18:16:33  InnoDB: Started; log sequence number 0 693044164
060603 18:16:34 [Note] mysqld-nt: ready for connections.
Version: '5.0.21-community-nt'  socket: ''  port: 3306  MySQL Community Edition
(GPL)

E:\MySQL5\bin>mysql -uroot -p
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 5.0.21-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
[3 Jun 2006 10:54] Liu xuanyu
I am want to run mysql with system service and normal work always when the windows 2003 system restarts .

I have offer my.ini files.
[3 Jun 2006 10:58] Liu xuanyu
when I close that DOS prompt, then mysql service cant starts again. view :1053
[3 Jun 2006 11:47] Miguel Solorzano
Thank you for the feedback.

What you meant with:

when I close that DOS prompt, then mysql service cant starts again.

Notice that when you start the server as standalone within a command
prompt you need to shutdown the server using the mysqladmin tool:

mysqladmin -uroot -p shutdown

in the picture you had attached shows a not server's clean shutdown,
then you need to track why that happened. Anyway shows the output
the below performed at a command prompt:

c:\mysql\bin>sc qc mysql
[SC] GetServiceConfig SUCCESS

SERVICE_NAME: mysql
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : c:\mysql\bin\mysqld-nt MySQL
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : MySQL
        DEPENDENCIES       :
        SERVICE_START_NAME : LocalSystem

The above assume that your service is called MySQL.
[3 Jun 2006 12:54] Liu xuanyu
well..., I am unstall 5.0.21 version.  and install new 5.0.22 version now. 

but new install mysql system service running, it is still can't link server normal work. 

Thank your said, I have use your ways. do its.

1. use MySQLInstanceConfig.exe stop mysql service 

2. use dos command: mysqld-nt --standalone --console

3. use dos command: mysqladmin -uroot -p shutdown

4. then restarts mysql service  just mysql  is can working.

 I am often use tools stop mysql service. After power cut or the phylogeny wrong restarts, this question then occurs.

windows system often need or auto restarts. we  should not use dos command stop mysql each times,right ?!  

So I think mysql should add auto fix not normal shutdown wrong. mysql should let us easy fix wrong and easy using. Do you think?! :) 

-- Liu.
[3 Jun 2006 15:52] Liu xuanyu
well.., try restarts windows system after. mysql still can't normal work. must use --console command can work. Please check its. I think mysql should has questions.
[3 Jun 2006 16:23] Liu xuanyu
I have try many ways for look for the question reason. 

when use dos command or use tool stop mysql service, it is can't full stop. mysql-nt.exe still run. so I am kill it. 

and use net start mysql  after, mysql still cant normal work linked. I have to use the command: net start mysql  --console . mysql can be work this time. 

So I think mysql5.0.* community version should has some questions. why cant full stop mysql service ? why start mysql service after, mysql still cant linked normal work. just assume normal shutdown mysql,but start after still normal work.  
and I am try use other windows Enterprise 2003 computer as also.
[3 Jun 2006 16:24] Liu xuanyu
I have try many ways for look for the question reason. 

when use dos command or use tool stop mysql service, it is can't full stop.
mysql-nt.exe still run. so I am kill it. 

and use net start mysql  after, mysql still cant normal work linked. I have to
use the command: net start mysql  --console . mysql can be work this time. 

So I think mysql5.0.* community version should has some questions. why cant full
stop mysql service ? why start mysql service after, mysql still cant linked
normal work. just assume normal shutdown mysql,but start after still not normal
work.  
and I am try use other windows Enterprise 2003 computer as also.
[3 Jun 2006 17:33] Miguel Solorzano
We're sorry, but the bug system is not the appropriate forum for 
asking help on using MySQL products. Your problem is not the result 
of a bug.

Support on using our products is available both free in our forums
at http://forums.mysql.com and for a reasonable fee direct from our
skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.
[10 Jun 2006 12:02] Liu xuanyu
Why did you say it does not have the wrong question? And the question frequently occurs. We were defer to the before normal flow installment. The present edition frequently appears this mistake.
[10 Jun 2006 16:11] Miguel Solorzano
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

How you posted before:

"and use net start mysql  after, mysql still cant normal work linked. I have to
use the command: net start mysql  --console . mysql can be work this time."

The --console argument is applied to start the server as standalone not as
service. Please read carefully our Documentation how to use the MySQL server
on Windows.

Thanks in advance.
[25 Jun 2006 10:11] Liu xuanyu
Simple said. its has two main questions:

1. when I stop mysql service, mysql cant full real stop. The mysql-nt.exe still running. 

2. when start mysql service, mysql not really worked.

Please tell me why it is?!
[27 Jun 2006 17:48] Miguel Solorzano
Thank you for your problem. Sorry I am not able to repeat with the
information you are provided, using your my.ini I am able to start/stop
the mysql service and connect with the mysql client.
[10 Jul 2009 11:39] Dariya Hussain
kill the mysql process and start again .. it has to work
[4 Apr 2011 18:17] David Mithiga
Must be a bug on MySQL 5.5. I resolved this by installing MySQL essential 5.1. Then uninstalled 5.5 after 5.1 worked Ok. This had really driven me nuts after all those online suggestions.
[29 Jun 2011 0:38] Jack Ripper
Does MySQL actually work on Windows  Machines? I really want to know, I have tried installing (and uninstalling of course) about 50 times, and am down to ver 5.1, none will allow DOS connection ...C:\<in the bin directory> mysql -u root -p

just hangs, after 30 hours, I am confident I have read 75% of shit on the web of everyone else having this problem, but I see NO solutions!!!
[29 Jun 2011 1:07] Jack Ripper
BTW error is

C:\program files\mysql\MySQL Server 5.1>cd bin

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root -p
Enter password: ********
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -u root mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

C:\Program Files\MySQL\MySQL Server 5.1\bin>

tried numerous things to no avail ... Win7 64bit, Apache, PHP, phpmyadmin, MySQL Workbench, have installed MS SQL 2008 because I didn't have the SQL server Browser, even installed MySQL Connector/ODBC 3.51, tried everything with odbcad32 in SysWOW64 .... hundreds more attempts with other things ... firewall is passing 3306 inbound and outbound (even though I am trying on local)