mysqldump: Got error: 2003: Can't connect to MySQL server on 'localhost' (10061) when trying to connect

when i am tring to do MySQLDump backup from console then getting such as above error. I am properly configure my MySQL Enterprise workbench and SQLyog ultimate tool. Able to do query and backup through that.

Kindly any one suggest me what i had mistake in system profile configuration of workbench. I have check out my connection parameter that is ok.

Do i need to configure anything anywhere? enter image description here

closed as off-topic by Jack Douglas Jan 1 '15 at 9:36

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Jack Douglas
If this question can be reworded to fit the rules in the help center, please edit the question.

  • please check if the service is running – Ahmad Abuhasna Dec 30 '14 at 12:51
  • Yes service is running properly and also i am able to take backup from mysql workbench tool. – Md Haidar Ali Khan Dec 30 '14 at 14:51
  • Is MySQL Server running on the standard port, 3306? Adding --port=3306 (or another port number, if you changed it) may help. Error 10061 means there is no service listening on the port where the connection is trying go ("connection refused.") – Michael - sqlbot Dec 31 '14 at 13:00
  • MySQL Server already --port=3306 had configured. There is no issue related to connection. – Md Haidar Ali Khan Dec 31 '14 at 13:03
  • 1
    There is no issue related to connection -- well, yes, there is. Error 10061 is absolutely an issue related to the connection. Either your my.ini has spurious or inconsistent configuration in the [client] or [mysqldump] vs. the [mysql] section, or you are passing an argument to mysql (when you start the command line client) that you also need to pass to mysqldump, such as host or port. – Michael - sqlbot Jan 1 '15 at 5:51

if you are able to start mysql from command line then there should be no error in taking dump as well

check to see if following command works, Either traverse to directory containing binaries or include them in path variable.
You can also include variables to include port,socket etc in your path.

mysql.exe -uroot -p -P3306

In order to take mysqldump use following,use switches to your conveniences.

mysqldump.exe -uroot -p -P3306 --all-databases --events >outfile.sql

Give It a try and let us know in case of any error.

Regards and Happy New Year.

  • C:\mysql-workbench-commercial-6.1.7-win32-noinstall\MySQL Workbench 6.1.7>mysql.exe -uroot -p -P3306 Enter password: ******** ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) – Md Haidar Ali Khan Jan 1 '15 at 7:44
  • what does this gives in your workbench query show variables like 'port'; I think you are using wrong connection parameters. – Nawaz Sohail Jan 1 '15 at 7:47
  • thanks for response , but getting the same error. Could you help me out for the specific connection parameters. – Md Haidar Ali Khan Jan 1 '15 at 7:59
  • have you tried to figure out with which port mysql is connecting using the query in above comments? – Nawaz Sohail Jan 1 '15 at 8:01
  • port number 3306 – Md Haidar Ali Khan Jan 1 '15 at 8:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.