Error while connecting to host 10061

I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error (Can't

I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to «Applying Security settings», at which point it gave me the above error (Can't connect to MySQL server on 'localhost' (10061)).

I do have a port 3306 exception in my firewall for ‘MySQL Server’.

Ian Gregory's user avatar

Ian Gregory

5,7501 gold badge28 silver badges42 bronze badges

asked Sep 23, 2008 at 3:52

Cameron A. Ellis's user avatar

Cameron A. EllisCameron A. Ellis

3,7938 gold badges38 silver badges46 bronze badges

0

Got this error on Windows because my mysqld.exe wasn’t running.

Ran «C:Program FilesMySQLMySQL Server 5.5binmysqld» —install from the command line to add it to my services, ran services.msc (start -> run), found the MySQL service and started it.

Didn’t have to worry about it from there on out.

answered Oct 11, 2011 at 4:18

ryanjones's user avatar

1

To resolve this problem:

  1. go to the task manager
  2. select Services tab
  3. find MySql service
  4. Running

That’s all.

TLama's user avatar

TLama

74.5k17 gold badges208 silver badges380 bronze badges

answered Mar 12, 2014 at 12:55

JapoDeveloper's user avatar

5

You’ll probably have to grant ‘localhost’ privileges to on the table to the user. See the 'GRANT' syntax documentation. Here’s an example (from some C source).

«GRANT ALL PRIVILEGES ON %s.* TO ‘%s’@’localhost’ IDENTIFIED BY ‘%s'»;

That’s the most common access problem with MySQL.

Other than that, you might check that the user you have defined to create your instance has full privileges, else the user cannot grant privileges.

Also, make sure the mysql service is started.

Make sure you don’t have a third party firewall or Internet security service turned on.

Beyond that, there’s several pages of the MySQL forum devoted to this:
http://forums.mysql.com/read.php?11,9293,9609#msg-9609

Try reading that.

Sathish D's user avatar

Sathish D

4,83629 silver badges44 bronze badges

answered Sep 23, 2008 at 3:58

Chris's user avatar

ChrisChris

4,7941 gold badge22 silver badges17 bronze badges

I had difficulty accessing MySQL while connecting via a localhost connection on the standard port 3306, which worked fine when I installed and configured it for prior classes I had taken in MySQL and Java. I was getting errors like «error 2003» and «Cannot connect to MySql server on localhost (10061)». I tried connecting from both MySQL Workbench (5.2.35 CE) and Netbeans (7.2). I am using Windows 7 64 bit professional.

I tried typing in services.msc in the start menu search box, which opened the services dialog box to show all the services installed in windows. I scrolled down to MySQL and started this service. Subsequent attempts to connect to MySQL from MySQL WorkBench and from the command prompt succeeded.

answered Nov 1, 2012 at 1:13

Colin's user avatar

ColinColin

7296 silver badges3 bronze badges

1

English:

  • press Windows + R
  • write «services.msc». Then press Enter
  • search for MySQL57 and right click
  • click on start the service

Français :

  • Appuyez sur la touche Windows + R
  • Écrire «services.msc» Puis appuyez sur Entrée
  • Recherchez MySQL57 et clic droit
  • Cliquez sur rédémarrer

jpaugh's user avatar

jpaugh

6,4754 gold badges36 silver badges90 bronze badges

answered Jul 6, 2017 at 8:19

Sofia's user avatar

SofiaSofia

1492 silver badges9 bronze badges

press Windows key + R
write «services.msc» enter
search for «MYSQL56»
write click on it and start the service

Chetan Bhagat's user avatar

answered Nov 20, 2015 at 3:34

Mujtaba Zaidi's user avatar

Mujtaba ZaidiMujtaba Zaidi

5991 gold badge5 silver badges13 bronze badges

  1. Make sure that your windows host file (located at c://windows/system32/drivers/etc.host) has following line. If not, add it at the end

    127.0.0.1 localhost
    ::1 localhost
    
  2. Sometimes mysql can not trigger Windows to force start host services if firewall blocks it, so start it manually

win+run>>services.msc, select the «MySQL_xx» where «xx» is the name you have assigned to MySQL host services during setup. Click on ‘start’ to start from hyperlink appeared on left side.

piet.t's user avatar

piet.t

11.6k21 gold badges45 silver badges52 bronze badges

answered Oct 2, 2013 at 12:57

Uday Hiwarale's user avatar

Uday HiwaraleUday Hiwarale

3,9885 gold badges45 silver badges48 bronze badges

3

I tried Kuzhichamadam Inn’s solution and found that a slight change needed to be made.

MYSQL57 was a network service. I had tried this repeatedly with no success. When I opened services.msc I found another service for localhost: MySQL. I started that one using the process below and it worked.

run > services.msc > rightclick MySQL > properties >start

answered Jul 6, 2016 at 21:17

Ted WIlcox's user avatar

0

I got this error when I ran out of space on my drive.

answered Jul 1, 2016 at 15:02

MDave's user avatar

MDaveMDave

1,13512 silver badges28 bronze badges

Go to Run type services.msc. Check whether or not MySQL services are running. If not, start it manually. Once it is started, type MySQL Show to test the service.

answered Aug 24, 2017 at 6:12

Muhammad Abbas's user avatar

To connect locally to MySql, you do not have to setup a firewall with inbound rules. But, even if you already setup iptables to allow the TCP inbound port 3306 and grant the privilege to the user to access the db locally, you may have to setup the bind address in your my.cnf file, edit the default address there and put the server IP address that is running the MySql service.

Brian's user avatar

Brian

5,0497 gold badges37 silver badges47 bronze badges

answered Aug 16, 2013 at 19:46

user2690551's user avatar

0

Since I have struggled and found a slightly different answer here it is:

I recently switched the local (intranet) server at my new workplace. Installed a LAMP; Debian, Apache, MySql, PHP. The users at work connect the server by using the hostname, lets call it «intaserv». I set up everything, got it working but could not connect my MySql remotely whatever I did.

I found my answer after endless tries though. You can only have one bind-address and it cannot be hostname, in my case «intranet».

It has to be an IP-address in eg. «bind-address=192.168.0.50».

answered Jan 28, 2016 at 8:34

iknownothing's user avatar

run > services.msc > rightclick MySQL57 > properties >set start type option to automatic

after restarting computer

At cmd

cd: C:

C :> cd "C:Program FilesMySQLMySQL Server 5.7bin"

it will become

C:Program FilesMySQLMySQL Server 5.7bin>

type mysql -u root -p

ie C:Program FilesMySQLMySQL Server 5.7bin> mysql -u root -p

Enter password: ****

That’s all

It will result in

mysql>

Phiter's user avatar

Phiter

14.3k14 gold badges50 silver badges83 bronze badges

answered Mar 9, 2016 at 14:22

Kuzhichamadam Inn's user avatar

Another possibility:

There are two ways the MySQL client can connect to the server: over TCP/IP, or using sockets. It’s possible you have your MySQL server configured to support socket connections, but not network connections.

answered Sep 23, 2008 at 4:49

dj_segfault's user avatar

dj_segfaultdj_segfault

11.9k4 gold badges28 silver badges36 bronze badges

1

Nothing to do just «Reset to Default» your firewall setting it will start working.

I read many solutions but nothing worked properly, so at last I reset firewall settings which worked.

answered Apr 17, 2013 at 8:13

Tarun's user avatar

1

finally solved this.. try running mysql in xammp. The check box of mysql in xammp should be unclicked. then start it. after that you can open now mysql and it will now connect to the localhost

answered Dec 15, 2013 at 3:42

user3103628's user avatar

1

Edit your ‘my-default.ini’ file (by default it comes with commented properties)as below ie.

basedir=D:/D_Drive/mysql-5.6.20-win32
datadir=D:/D_Drive/mysql-5.6.20-win32/data
port=8888

There is very good article present that dictates commands to create user, browse tables etc ie.

http://www.ntu.edu.sg/home/ehchua/programming/sql/MySQL_HowTo.html#zz-3.1

Tamil Selvan C's user avatar

answered Aug 6, 2014 at 13:53

hmehandi's user avatar

hmehandihmehandi

3364 silver badges10 bronze badges

  1. Right click on My Computer
  2. Click on Manage
  3. Go to Services and Application
  4. Select Services and find MySQL service
  5. Right click on MySQL and select Start

answered Aug 11, 2016 at 7:28

Mukunda Jois 's user avatar

I installed MySQL using mysql-installer-5.5.20.0.msi on Windows 7.
From the cmd window, I run «mysqlshow -u root -p». It asked for a password, then returned this error: «Can’t connect to MySQL server on ‘localhost’ (10061)» This is a bad indication of partially failed/successful installation.

After reading the page, http://dev.mysql.com/doc/refman/5.5/en/windows-troubleshooting.html, it told me to find an error log (.err) in C:Program FilesMySQLMySQL Server 5.5data. The directory exists but there is no log file.

I have a feeling this is related to the tight security of Windows 7, especially when installing a Unix based software. And yes, I am the Administrator on my PC.

Any help or suggestions is appreciated. And I can return a favor by answering Java and SQL query questions.

asked Jun 5, 2012 at 6:31

The Original Android's user avatar

12

Please Try the following steps:

  1. c:mysqlbin>mysqld —install
  2. c:mysqlbin>mysqld —initialize

then press «Windows key + R» write «services.msc«, run as admin

start MySQL service.

K. Yen's user avatar

K. Yen

1831 silver badge14 bronze badges

answered Jan 19, 2016 at 7:21

maheshDeshmukh's user avatar

5

I also faced the same issue and resolved it by below setups:

  1. Check the MYSQL service in the windows service. If it is there and not running then start it. It will solve your problem.

    You can find the services window by navigating to windows Start menu and typing ‘services’ in the search bar. Select the ‘Services’ option with the cogs next to it (not the executable file) and the below window will appear. Scroll down to find ‘MySql (version)’. When you select MySql you should see an option in the left pane that says ‘Start the service’. Click this and a dialogue should appear to indicate Windows is attempting to start the service. Once started the left pane will now give you the option to stop, pause and restart the service and you will now be able to connect to your MySql from the windows cmd line.

enter image description here

  1. If MYSQL service is not present in windows service then follow below setups.

    a. Open cmd as administrator.

    b. cd to C:Program Files (x86)MySQLMySQL Server 5.6bin

    c. Run the command:
    C:Program Files (x86)MySQLMySQL Server 5.6bin>mysqld.exe —install

    d. Check the MySql in the windows service, And if it is not running, Start it by clicking on the service.

    e. If your using XAMMP . Start MySQL at the XAMMP control Panel.


Burkely91's user avatar

answered Apr 29, 2017 at 13:23

Programming-Lover's user avatar

5

this issue is very to solve by windows server users

  1. go to this path
    C:Program FilesMySQLMySQL Server 5.1bin

  2. run this tool «MySQLInstanceConfig.exe»

and config the instatnce again and problem solved

answered Nov 18, 2013 at 9:05

shay lami's user avatar

shay lamishay lami

3763 silver badges2 bronze badges

4

The simple solution that worked for me is: change localhost to 127.0.0.1 in your database.yml or in your script if writing one.

doubleDown's user avatar

doubleDown

7,8181 gold badge32 silver badges48 bronze badges

answered Oct 27, 2012 at 3:16

Keramat's user avatar

KeramatKeramat

1211 silver badge3 bronze badges

1

Here, you need to make sure that the MySQL service is running is Windows. It might be possible that your MySQL service is not running cuurrently.

  1. Open Services window by pressing Windows+R and entering services.msc
  2. Find out MySQL right click and select start.

It works.

7bStan's user avatar

7bStan

1604 silver badges13 bronze badges

answered Apr 11, 2020 at 8:16

Arianne Hernandez's user avatar

1

I had this error — stupid mistake was, I was using -p3307 to specify port, whereas I should have used -P3307, i.e. capital P. Small ‘p’ is for password arg :)

answered Aug 26, 2014 at 13:15

Frederik Struck-Schøning's user avatar

In Windows 7

  1. press Windows+R it opens Run
  2. Enter services.msc
  3. Find out mysql right click and start
  4. if mysql was not found
    1. Run cmd as administrator
    2. goto C:Program Files (x86)MySQLMySQL Server 5.6bin directory(to go back use cd..) and type mysqld.exe --install
  5. follow step 3

That’s all

barbsan's user avatar

barbsan

3,36811 gold badges21 silver badges28 bronze badges

answered Jun 10, 2017 at 18:13

nikhil's user avatar

nikhilnikhil

811 silver badge1 bronze badge

2

I solved this by adding the following arguments to the command line string:

mysql --user username --password password --host localhost --port 3306 databasename < "system path to .sql file"

Without the --host and --port arguments, especially if you change the port to let’s say 3307, which is a non default value, will cause this error.

barbsan's user avatar

barbsan

3,36811 gold badges21 silver badges28 bronze badges

answered Jan 14, 2018 at 9:59

Charles Robertson's user avatar

2

I got this error in command prompt when I tried to open MySQL from cmd «mysql -u root -p»
Can’t connect to MySQL server on ‘localhost:3306’ (10061)
It was because I changed my port during the installation of MySQL community server as I had XAMPP server installed and running as well which was not allowing me to use the port 3306.
So basically I had 2 MySQL servers installed in my system.

  1. MySQL community server.
  2. XAMPP server.

If anyone had this same issue this is how I fixed it.
Step 1: Reconfigure MySQL server to port 3306
Step 2: Reconfigure XAMPP to use a different port other than 3306

Note: Stop the XAMPP server before following the steps.

Step 1: Reconfigure MySQL server to port 3306

  1. Click Start and open MySql installer — community
  2. Click on reconfigure button in front of MySql server
  3. Type 3306 in port. Execute and complete the installation.
    enter image description here

Step 2: Reconfigure XAMPP to use a different port other than 3306

  1. Open XAMPP and change the port other than 3306 in two files
    my.ini under MySQL
    and php.ini under Apache
    enter image description here

Now everything seems to be working fine for me. I was able to get into MySQL community server from cmd and I can use XAMPP server as well.

Dharman's user avatar

Dharman

29.3k21 gold badges80 silver badges131 bronze badges

answered Aug 11, 2021 at 15:16

mrsagar105's user avatar

mrsagar105mrsagar105

1762 silver badges6 bronze badges

I have Windows 8.1 and I too had this problem. My teacher told me it was probably because my MySQL server had stopped running. She told me to go into the Computer Management utility (right click the lower-most left hand corner of the screen on Windows 8.1 to access Computer Management). Then under Services and Applications, open up the Services and find MySQL. You should be able to right-click on MySQL and restart it.

answered Jan 26, 2015 at 7:04

Avilio's user avatar

AvilioAvilio

5716 silver badges4 bronze badges

  1. In Start Menu, search for «mysql». Among the results, you should see the «MySQL Installer — Community». Run it.

  2. MySQL Installer window will show up as shown below. Find «MySQL Server» under Product and click on «Reconfigure» link.

  3. The MySQL Installer will show up (same one you used for the first MySQL Server installation). Go through all the steps.

  4. After the MySQL Installer was finished, I started the MySQL service again. This time, the «Startup Message Log» on The MySQL Notifier was showing that the server started successfully:

MySQL : How to fix Can’t connect to MySQL server on localhost 10061 error

answered Aug 30, 2018 at 15:30

nishith kumar's user avatar

This is the easiest solution and worked for me.

  • Go to where you downloaded
    «mysql-installer-web-community-8.0.19.0.msi», file for installing
    mysql.
  • Run this by double clicking on it. (No need to uninstall anything)
  • Click on «reconfigure» beside the MySql server.
  • Agree everything which comes in middle, provide password for root where asked.
  • Finish. That’s it you’re good to go.

answered May 19, 2020 at 6:11

Rama Krishna Reddy's user avatar

2

For the 5.7 version, I had the same problem and a simple fix did the trick. As Installed the workbench 5.7 there was another «software» of sorts called the «MySQL Installer Community». I ran this and ran the «Reconfigure» for the MySQL server. It took about a minute and the problem was no longer there.

Hope it works!.(Keep in mind i was using the 5.7 version)

answered Feb 27, 2017 at 22:08

user0221441's user avatar

user0221441user0221441

3484 silver badges11 bronze badges

Just turn off the firewall and remove the instance configuration. Add a new instance for the server.![Disable Firewall][1]
Give he port number correctly as 3306 as default

answered Jul 25, 2013 at 17:41

Prabhakar's user avatar

Solution 1:

For 32bit:
Run «mysql.exe» from: C:Program FilesMySQLMySQL Server 5.6bin

For 64bit:
Run «MySQLInstanceConfig.exe» from: C:Program FilesMySQLMySQL Server 5.6bin

Solution 2:

The error (2002) Can’t connect to … normally means that there is no
MySQL server running on the system or that you are using an incorrect
Unix socket file name or TCP/IP port number when trying to connect to
the server. You should also check that the TCP/IP port you are using
has not been blocked by a firewall or port blocking service.

The error (2003) Can’t connect to MySQL server on ‘server’ (10061)
indicates that the network connection has been refused. You should
check that there is a MySQL server running, that it has network
connections enabled, and that the network port you specified is the
one configured on the server.

Source: http://dev.mysql.com/doc/refman/5.6/en/starting-server.html
Visit it for more information.

answered Nov 12, 2014 at 17:35

Muhammad Rehan Qadri's user avatar

1

I had the same error. I resolved in this way

Go to start- MySQL Installer-community and run again the installer as a re-configuration(you will be asked so).

Once asked if you want make MySQL instance to run as a Windows service, check the box.

In case would do not work, try unistalling and installing again, and check the box to run MySQL as Windows service.

answered Jun 8, 2016 at 16:28

Carmine Tambascia's user avatar

3

From what I’ve gathered this means the mysql service (mysqld) isn’t running.

  • First make sure it is installed as a windows service : Run

"C:Program FilesMySQLMySQL Server 5.5binmysqld" --install

from the command line.

  • Next, start it up :

services.msc > MySQL > start

If it fails to restart, then you can follow these steps :

  • open the command line as an administrator :
    cmd.exe > open as administrator
  • run "C:Program FilesMySQLMySQL Server 5.7binmysqld" --verbose

it should fail and put the error log in a directory named data under C:Program FilesMySQLMysSQL Server 5.7 . If it fails to create data for some reason, do it manually under that directory and try again. If you can figure out what’s missing from what’s in that log, then good, you’re done.

If you’ve still got no luck, this is how I did it :

  • goto C:ProgramDataMySQL and copy the file named my.ini to C:Windows

  • try to start the service again from the command line :
    "C:Program FilesMySQLMySQL Server 5.7binmysqld" --verbose

If it doesn’t display any error, than the service startup was successfull. If it’s still not working, than delete that my.ini you just copied from C:Windows and start the service from the command line once again.

it should work now

answered Oct 31, 2016 at 18:37

Paul Mira's user avatar

Paul MiraPaul Mira

711 silver badge3 bronze badges

if it is showing error 2003 (HY000): Can’t connect to MySQL server on localhost (10061) than

  1. Search services.msc in run
  2. goto mysql properties
  3. copy the mysql service name
  4. start cmd as administrator
  5. write: net start mysqlservicename .i.e mysql57 or etc it will show mysql is starting.

Christopher Moore's user avatar

answered Apr 7, 2017 at 8:31

neo.abi1000's user avatar

For me, three steps solved this problem on windows 10:

I downloaded MySQL server community edition zip and extracted it in the D drive. After that I went to bin folder and did cmd on that folder. I followed the below steps and all works:

D:toolsmysql-8.0.17-winx64bin>mysqld -install
Service successfully installed.

D:toolsmysql-8.0.17-winx64bin>mysqld --initialize
D:toolsmysql-8.0.17-winx64bin>net start mysql
The MySQL service is starting...
The MySQL service was started successfully.

Kevin's user avatar

Kevin

15.6k7 gold badges53 silver badges70 bronze badges

answered Aug 20, 2019 at 11:46

vikash chauhan's user avatar

I too had this problem, its easy to solve:

Go to Control panel — System and maintenance — System — Advanced system settings — Environment variables — System variables — path — click edit — add

"c:xamppmysqlbin" — it should look like this :

Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program Files (x86)InteliCLS Client;C:Program FilesInteliCLS Client;%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;%SYSTEMROOT%System32WindowsPowerShellv1.0;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelOpenCL SDK2.0binx86;C:Program Files (x86)IntelOpenCL SDK2.0binx64;C:Program Files (x86)Windows LiveShared;C:Program Files (x86)QuickTime AlternativeQTSystem;c:xamppmysqlbin

And don’t forget to start MySQL from control panel of Xampp.

Valentin Despa's user avatar

answered Jun 3, 2013 at 8:31

Siddharth Patel's user avatar

Siddharth PatelSiddharth Patel

1931 gold badge2 silver badges15 bronze badges

1

I found the same error re occurring even after I tried all the above solutions given above. I had even tried version 5.7 and few more. Guys don’t waste your time trying to fix it. Rather install version 5.5. It’s working perfectly fine without any unnecessary error.

answered Jul 1, 2018 at 16:48

Shruti's user avatar

Well in my case I just opened services.msc using run and restarted 2 of the services related to mysql and it worked!

answered Sep 21, 2018 at 7:28

Aditya's user avatar

In case of Xampp Installation.

Go to your xampp installation and mysql folder, for my case: C:xamppmysql

Run the file «resetroot.bat» from cmd or explorer.

My installation started working!!!

answered Nov 23, 2018 at 8:52

Sachin's user avatar

The solution that fixed the issue was using the following steps:

In Start Menu, search for «mysql». Among the results, you should see the «MySQL Installer — Community». Run it.
MySQL Installer window will show up as shown below. Find «MySQL Server» under Product and click on «Reconfigure» link.
MySQL Installer Community

The MySQL Installer will show up (same one you used for the first MySQL Server installation). Go through all the steps.

After the MySQL Installer was finished, I started the MySQL service again.

answered Dec 16, 2018 at 16:49

ankit715's user avatar

Don’t do useless stuff like reconfigure, stop MySQL and start MySQL in service.
Just reinstall the MYSQL server and again install it in your system.
Remember only uninstall MySQL server and nothing else.
All the problem will be solve automatically

answered Aug 6, 2019 at 16:32

VINEET KUMAR's user avatar

The main reason for this kind of error is you might have uninstalled Mysql server application. Install it and then give it a go.

answered Aug 26, 2019 at 9:28

Prateek Gowda's user avatar

I had the same issue and basically resolved it by pointing to a specific port number that my MySQL server was running on. Below is the command. Please edit the code to fit your case i.e your port number,your mysql server username,your password.

    mysql -u root -pYourMysqlRootPassword -P3307 

answered Oct 11, 2019 at 11:35

Munyiri Tom's user avatar

Munyiri TomMunyiri Tom

1322 silver badges4 bronze badges

  1. Create the temp folder c:/mysqltmp
  2. In my.ini file under [mysqld] add the line
    tmpdir=c:/mysqltmp
  3. Add full privileges to user NETWORK SERVICE for «C:ProgramDataMySQLMySQL Server X.YDataibdata1″ file
  4. Start service

These are steps for the same problem with MySQL5.7 and MySQL8.0 on Windows 10

answered Oct 11, 2019 at 21:03

nesomis's user avatar

Содержание

  1. Error while connecting to host 10061
  2. Asked by:
  3. Question
  4. How to fix MySQL can’t connect to server on localhost (10061) error
  5. Make sure that your MySQL service is actually running
  6. MySQL service is missing from the Services panel
  7. Check that you are attempting to connect to the right port number
  8. Level up your programming skills
  9. About
  10. Winsock Error 10061 – How we fix it
  11. How to fix Winsock Error 10061?
  12. Common causes for this Error:
  13. Steps to fix Winsock Error 10061
  14. Conclusion
  15. PREVENT YOUR SERVER FROM CRASHING!
  16. Не удается подключиться к серверу MySQL на ‘localhost’ (10061)
  17. 18 ответов:
  18. Error while connecting to host 10061
  19. Answered by:
  20. Question
  21. Answers
  22. All replies

Error while connecting to host 10061

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Asked by:

Question

Hi! I’m trying to use a LAMMPS prebuilt executable on my windows machine, using parallel libraries through OpenMP, I tried many ways to call the mpiexec, to no avail, I always get the same error, which says :

ERROR:Error while connecting to host, No connection could be made because the target machine actively refused it. (10061)

I tried asking it to give me debug information and allowing both mpiexec.exe and smpd.exe in the windows firewall, but it didn’t change a thing.

If that can help, I am running this on my own machine, on which I’m the administrator in an administration command window, system runs on Win10 with an AMD Ryzen 1700X processor.

I put the entire output as well as my call to mpiexec in this pastebin : https://pastebin.com/aPebwPxg

Any help would be greatly appreciated! If you need any more detail don’t hesitate, I’ll answer as fast as I can!

Источник

How to fix MySQL can’t connect to server on localhost (10061) error

Posted on Sep 13, 2021

When you’re done installing a MySQL server application on Windows operating system, you can try to login to your MySQL server by using the mysql command from the Command Line.

But sometimes you may get the MySQL 2003 error saying it can’t connect to MySQL server as shown below:

The error above means that your request to connect to the MySQL server has been refused.

There are two things you need to check to fix this error:

  • Make sure that your MySQL service is actually running
  • Check that you are attempting to connect to the right port number

This tutorial will help you to do both, starting with checking MySQL service status.

Make sure that your MySQL service is actually running

To fix this error, you need to make sure that your MySQL server service is actually running in the Services panel.

First, open the Windows Start menu and search for the Services panel to see the result below:

Then, scroll through the services list until you reach the services that start with «M» to look for MySQL services.

Usually, you have the MySQL version number attached to the service name.

The MySQL version installed on my computer is MySQL 8.0.26 so I have MySQL80 service listed as shown below:

If you have MySQL version 7, then you may have MySQL70 listed on the Services panel.

As you can see from the picture above, the status of MySQL80 service is empty, meaning that it’s not currently running.

If you see the same status, you can run the service by clicking the Start the service link on the left pane.

Now you can try to connect again to your MySQL server from the Command Line.

MySQL service is missing from the Services panel

If you don’t find MySQL service from the Services panel, then you may not have installed MySQL as a Windows service.

It’s always recommended to install MySQL as a Windows service so that you can start and stop a running MySQL program easily.

To install the MySQL service, you can run the mysqld —install command from the command line as follows:

Please note that you need to have Administrator access to perform the installation above.

Alternatively, you can re-run the MySQL installer program and choose to reconfigure the installed MySQL server as shown below:

In the reconfigure wizard panel, click on Next until you get into the Windows Service section.

You should check the box that says Configure MySQL Server as a Windows Service as follows:

When you’re done, click on Next and then click on Execute to run the changes.

Now you should be able to find MySQL under the Services panel.

Check that you are attempting to connect to the right port number

When you run a MySQL service on your computer, the service will start MySQL server and allows you to connect to the server under a specific port number.

By default MySQL uses port 3306 but you can check the one you are currently using in your my.ini file.

The my.ini file is a MySQL configuration file used to properly configure the running MySQL services.

When you install MySQL using the official installer, then you should have a my.ini file located under your MySQL installation folder.

For example, mine was located under C:ProgramDataMySQLMySQL Server 8.0 folder as shown below:

Once you find the file, open it and find the [client] section.

You should find the port number assigned under the section as shown below:

Once you find the port number, and the number to the mysql command when you try to login as follows:

Now you should be able to connect to your local MySQL server. Nice work! 👍

Level up your programming skills

I’m sending out an occasional email with the latest programming tutorials. Drop your email in the box below and I’ll send new stuff straight into your inbox!

About

Nathan Sebhastian is a software engineer with a passion for writing tech tutorials.
Learn JavaScript and other web development technology concepts through easy-to-understand explanations written in plain English.

Источник

Winsock Error 10061 – How we fix it

by Sushali Dasan | Feb 11, 2021

Stuck with Winsock Error 10061? We can help you.

Winsock error 10061 occurs when the target machine we are trying to connect actively refuses the request.

This ‘Connection Refused’ error happens generally when the service with which we are trying to connect is inactive.

Here at Bobcares, we often get requests from our customers to fix similar errors as a part of our Server Management Services.

Today let’s see how our Support Engineers fix this error for our customers.

How to fix Winsock Error 10061?

Before going into the steps of fixing Winsock Error 10061, we will see some of the common causes for this error.

Common causes for this Error:

1. The most common cause is a misconfigured server, full server, or using an incorrect port to connect.

2. Poor or no internet connection.

3. Service inactive on the destination server.

4. Trying to connect to the wrong host.

5. Using a port number that is higher than 655355.

6. A firewall or anti-virus software on the local computer or network connection blocking the connection.

7. Corrupted registry.

Steps to fix Winsock Error 10061

1. First we must check if the Internet connection is working properly or not.

2. Next we need to ensure that firewall is not blocking the Winsock connection.

Generally, firewalls are designed to prevent unauthorized access soo there is a possibility that it can see Winsock as a potential threat.

To unblock Winsock, we can use the following steps:

a. First, locate the firewall in the navigation bar (next to the clock)
b. Then right-click and take the “Exception List”
c. In the exception list, if Winsock is not already displayed, we will add it.

3. Run a scan to check for potential threats or viruses using any anti-virus.

4. Clean out the registry using a registry cleaner to scan through the part of the PC and repair any of the damaged settings if any.

5. After that we can verify whether the host is resolving to the correct IP address

6. Then we will check whether the ports are open and listening.

7. We must keep in mind to use any port less than 65535.

8. After this we will ensure that the service can be connected to all IP addresses. Also, we will check if the ISP allows outbound traffic on port 25.

10. If all the above steps did not help to connect, we will disable the firewall or anti-virus software and try to connect again.

Conclusion

To conclude, we saw various causes for Winsock error 10061 along with the steps our Support Techs follow to fix this error for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Источник

Не удается подключиться к серверу MySQL на ‘localhost’ (10061)

Я недавно установил MySQL 5 на Windows 2003 и попытался настроить экземпляр. Все работало нормально, пока я не добрался до «применения настроек безопасности», после чего он дал мне вышеуказанную ошибку ( Can’t connect to MySQL server on ‘localhost’ (10061) ).

У меня есть исключение порта 3306 в моем брандмауэре для «MySQL Server».

18 ответов:

вам, вероятно, придется предоставить привилегии «localhost» в таблице пользователю. Смотрите ‘GRANT’ синтаксис документации. Вот пример (из какого источника).

«предоставить все привилегии на %s.* для’%s’@ ‘localhost’, идентифицированного ‘%s’»;

Это самая распространенная проблема с MySQL.

кроме этого, вы можете проверить, что пользователь, которого вы определили для создания вашего экземпляра, имеет полные права, иначе пользователь не может предоставлять привилегии.

кроме того, убедитесь, что служба mysql запущена.

убедитесь, что у вас не включен сторонний брандмауэр или Служба безопасности Интернета.

кроме того, есть несколько страниц форума MySQL, посвященных этому: http://forums.mysql.com/read.php?11,9293, 9609#msg-9609

попробуйте прочитать это.

получил эту ошибку на Windows, потому что мой mysqld.exe не работал.

побежал «C:Program FilesMySQLMySQL Server 5.5binmysqld» —install из командной строки, чтобы добавить его в мои службы, запустите службы.msc (start -> run), нашел службу MySQL и запустил ее.

не пришлось беспокоиться об этом оттуда.

  1. идем в Диспетчер задач
  2. выберите вкладку Услуги
  3. найти службу MySql
  4. под управлением

У меня были трудности с доступом к MySQL при подключении через соединение localhost на стандартном порту 3306, который отлично работал, когда я установил и настроил его для предыдущих классов, которые я взял в MySQL и Java. Я получал ошибки, такие как» ошибка 2003 «и»не удается подключиться к серверу MySql на localhost (10061)». Я попытался подключиться как из MySQL Workbench (5.2.35 CE), так и из Netbeans (7.2). Я использую Windows 7 64 bit professional.

Я попытался ввести службы.msc в самом начале окно поиска меню, которое открыло диалоговое окно службы, чтобы показать все службы, установленные в windows. Я прокрутил вниз к MySQL и запустил эту службу. Последующие попытки подключиться к MySQL из MySQL WorkBench и из командной строки завершились успешно.

убедитесь, что ваш хост-файл windows (расположен по адресу c://windows/system32/drivers/etc.host ) имеет следующие линии. Если нет, добавьте его в конце

иногда mysql не может вызвать Windows для принудительного запуска служб хоста, если брандмауэр блокирует его, поэтому запустите его вручную

win + выполнить >>услуги.msc, выберите «MySQL_xx», где» xx » — это имя, которое вы назначили службам хоста MySQL во время установки. Нажмите на кнопку «начать», чтобы начать с гиперссылки появился на левой стороне.

Я попробовал решение Kuzhichamadam Inn и обнаружил, что необходимо внести небольшое изменение.

MYSQL57 был сетевой службой. Я пробовал это неоднократно без успеха. Когда я открыл службы.msc я нашел другой сервис для localhost: MySQL. Я начал это с помощью процесса ниже, и это сработало.

выполнить > Services.МСЦ > правой кнопкой мыши по MySQL > «свойства» >в начало

пресс клавиша Windows + R напишите » услуги.МСЦ» введите ищите «MYSQL56» напишите нажмите на нее и Запустите сервис

Источник

Error while connecting to host 10061

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

Answers

Evn i am gettin the same error. Can u tell me wat is the fix.

I am getting the same error — but only when I change my return type to a cutom object. CLR types work fine — i.e. an IList of Strings, but not, say, MyResponseObj. I’m running the asp.net development server on port 1212, with a wsHttpBinding. Like I said, the problem seems to be with the return type which is marked up with the DataContract — DataMember tags, like my other custom objects that work fine as input objects. I am able to pass in an arbitrarily complex object of custom types no problem — but the server tanks with a custom return type.

Any suggestion would be appreciated. Thanx — Ian

Regarding the custom-return-types problem, if you configure tracing

are there any exceptions on the server?

I’ve configured trace in the web.config file as per the article, but no output or log file is generated. Do I need to create a trace object in my test code (NUnit) to explicitly start the trace segment?

Or should the web.config entry be sufficient?

I’ve unblocked the port on the firewall and still unable to connect.

What was the fix?

I am getting this error if I host it using a console application. it works fine if client is asp.net. Is there a fix for this?

try to remove and add service refrences again. it will help you to connect wcf.

I am also getting same error when I host with the windows service.

Same application when hosted in Console application, works fine.

Can you please help me with the fix.

Thanks in advance.

service behaviorConfiguration = » LCCService.rbagLCWS_ServiceBehavior «

endpoint address = » mex «

behavior name = » LCCService.rbagLCWS_ServiceBehavior » >

userNameAuthentication userNamePasswordValidationMode = » MembershipProvider » membershipProviderName = » PasswordProvider »/>

serviceMetadata httpGetEnabled = » true »/>

serviceDebug includeExceptionDetailInFaults = » true »/>

binding name = » LCCService.rbagLCWS_ServiceBinding » >

security mode = » Transport » >

transport clientCredentialType = » Basic »/>

When I try to call the service using the client w/o having the test certification installed, I get the following error:
Could not connect to https://XYZ.com/rrxainet/LCCWCFService/rbagLCWS_service.svc. TCP error code 10061: No connection could be made because the target machine actively refused it XXX.XXX.XX.XXX:443.

I have spent almost 2 days trying to figure out the solution and how to successfully install the test certificate to get it working but to no avail.

Please can someone help. I really appreciate it.

i am new to dot net. when i am using the folling program for connecting the particuler port it is giving the error.

timout = Convert .ToInt32(txttimeout.Text);

IPAddress localAddr = IPAddress .Parse( «127.0.0.1» );

IPEndPoint remoteEndPoint = new IPEndPoint (localAddr, port);

TcpClient NetworkClient = TimeOutSocket .Connect(remoteEndPoint, timout);

NetworkStream networkstream = NetworkClient.GetStream();

StreamReader streamReader = new StreamReader (networkstream);

string line = streamReader.ReadToEnd(); //streamReader.ReadLine();

I got the same message after adding the registry value «KeepAliveTime» with value 300000 in the window registry under HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters.

When I removed the window registry «KeepAliveTime», it resumed normal.

Is there any settings I have to check ?

I am new to WCF. I have created a WCF Service and hosted it in Windows Service. I have got a below Error when tring to create Client Proxy for the service.

«There was an error downloading ‘http://localhost:8051/Service1/’.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8051
Metadata contains a reference that cannot be resolved: ‘http://localhost:8051/Service1/’.
Could not connect to http://localhost:8051/Service1/. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8051.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8051
If the service is defined in the current solution, try building the solution and adding the service reference again.»

I have seen some posts related to Issue like unblocking the port in Firewall. I have unblocked all ports from Firewall, Still the Issue raising while create Client Proxy. Some one can help me on this Problem. I have Pasted my configuration file below.

Источник

When you’re done installing a MySQL server application on Windows operating system, you can try to login to your MySQL server by using the mysql command from the Command Line.

But sometimes you may get the MySQL 2003 error saying it can’t connect to MySQL server as shown below:

mysql --user=[your username] --password=[your password]
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)

The error above means that your request to connect to the MySQL server has been refused.

There are two things you need to check to fix this error:

  • Make sure that your MySQL service is actually running
  • Check that you are attempting to connect to the right port number

This tutorial will help you to do both, starting with checking MySQL service status.

Make sure that your MySQL service is actually running

To fix this error, you need to make sure that your MySQL server service is actually running in the Services panel.

First, open the Windows Start menu and search for the Services panel to see the result below:

Then, scroll through the services list until you reach the services that start with "M" to look for MySQL services.

Usually, you have the MySQL version number attached to the service name.

The MySQL version installed on my computer is MySQL 8.0.26 so I have MySQL80 service listed as shown below:

If you have MySQL version 7, then you may have MySQL70 listed on the Services panel.

As you can see from the picture above, the status of MySQL80 service is empty, meaning that it’s not currently running.

If you see the same status, you can run the service by clicking the Start the service link on the left pane.

Now you can try to connect again to your MySQL server from the Command Line.

MySQL service is missing from the Services panel

If you don’t find MySQL service from the Services panel, then you may not have installed MySQL as a Windows service.

It’s always recommended to install MySQL as a Windows service so that you can start and stop a running MySQL program easily.

To install the MySQL service, you can run the mysqld --install command from the command line as follows:

mysqld --install
Service successfully installed.

Please note that you need to have Administrator access to perform the installation above.

Alternatively, you can re-run the MySQL installer program and choose to reconfigure the installed MySQL server as shown below:

In the reconfigure wizard panel, click on Next until you get into the Windows Service section.

You should check the box that says Configure MySQL Server as a Windows Service as follows:

When you’re done, click on Next and then click on Execute to run the changes.

Now you should be able to find MySQL under the Services panel.

Check that you are attempting to connect to the right port number

When you run a MySQL service on your computer, the service will start MySQL server and allows you to connect to the server under a specific port number.

By default MySQL uses port 3306 but you can check the one you are currently using in your my.ini file.

The my.ini file is a MySQL configuration file used to properly configure the running MySQL services.

When you install MySQL using the official installer, then you should have a my.ini file located under your MySQL installation folder.

For example, mine was located under C:ProgramDataMySQLMySQL Server 8.0 folder as shown below:

Once you find the file, open it and find the [client] section.

You should find the port number assigned under the section as shown below:

[client]

# pipe=

# socket=MYSQL

port=3306

[mysql]
no-beep

Once you find the port number, and the number to the mysql command when you try to login as follows:

mysql --user=[your username] --password=[your password] --port=3306

Now you should be able to connect to your local MySQL server. Nice work! 👍

  • Question

  • I hosted a wcf service application using windows services. When my client (ASP.NET) tries to call the service class hosted by the windows service, I get this error «TCP error code 10061: No connection could be made because the target machine actively refused it. «. Is there a fix for this? The same code works fine if I host it using a console application.

Answers

  • What port are you listening on? Is that port unblocked in your windows firewall?

All replies

  • What port are you listening on? Is that port unblocked in your windows firewall?

  • Yes, my firewall was blocking it. I got around it and it fixed the problem.

    • Proposed as answer by

      Friday, May 23, 2014 1:28 PM

  • Hi,

    Evn i am gettin the same error. Can u tell me wat is the fix.

  • I am getting the same error — but only when I change my return type to a cutom object. CLR types work fine — i.e. an IList of Strings, but not, say, MyResponseObj. I’m running the asp.net development server on port 1212, with a wsHttpBinding. Like I said, the problem seems to be with the return type which is marked up with the DataContract — DataMember tags, like my other custom objects that work fine as input objects. I am able to pass in an arbitrarily complex object of custom types no problem — but the server tanks with a custom return type.

    Any suggestion would be appreciated. Thanx — Ian

  • Brian

    I’ve configured trace in the web.config file as per the article, but no output or log file is generated. Do I need to create a trace object in my test code (NUnit) to explicitly start the trace segment?

    Or should the web.config entry be sufficient?

    Thanks,

    Ian

  • Kenny,

    I’ve unblocked the port on the firewall and still unable to connect.

    What was the fix?

  • For problem returning custom objects, turns out my IList<T> member variable, since it could be nullable, required this in the data contract: [DataMember(EmitDefaultValue = false)]
    That is what was causing the service to refuse the connection. Now all is well again.  A newbie error no doubt, but I never even heard of WCF before I started at my new company.  =o)

    • Proposed as answer by
      JeffKite
      Wednesday, August 14, 2013 6:32 PM

  • What port are you using? What binding is this? Can you connect to the port using IE (assuming you have an HTTP GET metadata enabled)?

  • Hi ,

    I am getting this error if I host it using a console application. it works fine if client is asp.net. Is there a fix for this?

    -ravi

  • try to remove and add service refrences again…it will help you to connect wcf…

  • Hi JothiMurugan,

    I am also getting same error when I host with the windows service.

    Same application when hosted in Console application, works fine.

    Can you please help me with the fix.

    Thanks in advance.

    Sakthi

  • hi
    i don’t know it will helpfull to u or not but u should try it
    first u click on  host  project and  click on Start new instance
    then u should run windows application

  • I have configured Tracing and I see my trace files just fine, the prblem is I don’t see an Error icon. 

    I’m looking through all the activities in the trace viewer and the one for my service operation has To and from transport messages, I can see the start for the activity but there is nothing indicating an error and I setup it up for  switchValue=»Error,ActivityTracing». 

    ??


    Santiago Perez

  • Hi,
    I am trying to write a WCF service with transport level security and basicHTTP binding. I am using a custom Membership provider to authenticate a client call to the service by authenticating the User ID and password passed to the service. I believe that WCF does not allow UserID/Password auth without having SSL certificate installed because the UserID/password are sent as clear text. I am currently in development and I tried installing the test certificate (X.509) on my dev machine running the service but w/o any success.
    My service web.config looks like this

    <

    system.serviceModel>

    <

    services>

    <

    service behaviorConfiguration=«LCCService.rbagLCWS_ServiceBehavior«

    name=«LCCService.rbagLCWS_Service«>

    <

    endpoint address=«»

    binding=«basicHttpBinding«

    bindingConfiguration=«LCCService.rbagLCWS_ServiceBinding«

    contract=«LCCService.IrbagLCWS_service«>

    </

    endpoint>

    <

    endpoint address=«mex«

    binding=«mexHttpBinding«

    contract=«IMetadataExchange« />

    </

    service>

    </

    services>

    <

    behaviors>

    <

    serviceBehaviors>

    <

    behavior name=«LCCService.rbagLCWS_ServiceBehavior«>

    <

    serviceCredentials>

    <

    userNameAuthentication userNamePasswordValidationMode=«MembershipProvider« membershipProviderName=«PasswordProvider«/>

    </

    serviceCredentials>

    <

    serviceMetadata httpGetEnabled=«true« />

    <

    serviceDebug includeExceptionDetailInFaults=«true« />

    </

    behavior>

    </

    serviceBehaviors>

    </

    behaviors>

    <

    bindings>

    <

    basicHttpBinding>

    <

    binding name=«LCCService.rbagLCWS_ServiceBinding«>

    <

    security mode=«Transport«>

    <

    transport clientCredentialType=«Basic«/>

    </

    security>

    </

    binding>

    </

    basicHttpBinding>

    </

    bindings>

    </

    system.serviceModel>

    When I try to call the service using the client w/o having the test certification installed, I get the following error:
    Could not connect to https://XYZ.com/rrxainet/LCCWCFService/rbagLCWS_service.svc. TCP error code 10061: No connection could be made because the target machine actively refused it XXX.XXX.XX.XXX:443.

    I have spent almost 2 days trying to figure out the solution and how to successfully install the test certificate to get it working but to no avail.

    Please can someone help. I really appreciate it!!!

  • hi guys,

    i am new to dot net. when i am using the folling program for connecting the particuler port it is giving the error.

    int

    timout = Convert.ToInt32(txttimeout.Text);

    int port = 5000;

    IPAddress localAddr = IPAddress.Parse(«127.0.0.1»);

    IPEndPoint remoteEndPoint = new IPEndPoint(localAddr, port);

    TcpClient NetworkClient = TimeOutSocket.Connect(remoteEndPoint, timout);

    NetworkStream networkstream = NetworkClient.GetStream();

    StreamReader streamReader = new StreamReader(networkstream);

    string line = streamReader.ReadToEnd(); //streamReader.ReadLine();

  • I got the same message after adding the registry value  «KeepAliveTime» with value 300000 in the window registry under HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters.

    When I removed the window registry «KeepAliveTime», it resumed normal.

    Is there any settings I have to check ?

  • Hi All,

     I am new to WCF. I have created a WCF Service and hosted it in Windows Service. I have got a below Error when tring to create Client Proxy for the service.

    Error Message:

    «There was an error downloading ‘http://localhost:8051/Service1/’.
    Unable to connect to the remote server
    No connection could be made because the target machine actively refused it 127.0.0.1:8051
    Metadata contains a reference that cannot be resolved: ‘http://localhost:8051/Service1/’.
    Could not connect to http://localhost:8051/Service1/. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8051.

    Unable to connect to the remote server
    No connection could be made because the target machine actively refused it 127.0.0.1:8051
    If the service is defined in the current solution, try building the solution and adding the service reference again.»

    I have seen some posts related to Issue like unblocking the port in Firewall. I have unblocked all ports from Firewall, Still the Issue raising while create Client Proxy. Some one can help me on this Problem. I have Pasted my configuration file below.

    <system.serviceModel>
        <services>
          <service name=»WcfService1.Service1″ behaviorConfiguration=»WcfService1.Service1Behavior»>
            <!— Service Endpoints —>
            <endpoint address=»» binding=»wsHttpBinding» contract=»WcfService1.IService1″>
            </endpoint>
            <!—<endpoint address=»» binding=»netTcpBinding» contract=»WcfService1.IService1″></endpoint>—>
            <!—<endpoint address=»mextcp» binding=»mexTcpBinding» contract=»IMetadataExchange»/>—>
            <endpoint address=»mex» binding=»mexHttpBinding» contract=»IMetadataExchange»/>
            <host>
              <baseAddresses>
                <add baseAddress = «http://localhost:8051/Service1/» />
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name=»WcfService1.Service1Behavior»>
              <!— To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment —>
              <serviceMetadata httpGetEnabled=»true»/>
              <!— To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information —>
              <serviceDebug includeExceptionDetailInFaults=»false»/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

    Please reply me to solve this problem.

  • I started getting this problem in VS 2008 IDE when I’m testing my web services.  Not a firewall issue.  Anyone find a positive solution to this??

    My Web Service test web application used to work fine a few months ago — now when I test it I get this error?  So I’m guessing some OS update has broken VS 2008 IDE for web services??

    Rob

  • Solved the problem for my case (appears to a Project’s Web Service reference issue):

    In VS 2008 IDE

    In your actual Web Services Project (with the ASMX source) — My Project | Web | Use Visual Studio Development Server | Auto-assign Port.

    a. If this is hard coded to a specific port you’ll need to verify the calling Project’s Web Service references match the same port and reference.

    b. Open your calling project — My Project | References — remove your Web Service references (Type = Service) — be sure to note the ReferenceName you used.  Now Add Service Reference back again — Discover Services in Solution, select the service
    and be sure to re-enter the same ReferenceName you used originally.

    If your Web Service project is configured differently or you reference external web services, then it might just be a case of removing and re-adding the web service back being sure to use the same ReferenceName so you project references stay intact.

    Rob.

    • Proposed as answer by
      Rob Ainscough
      Monday, August 2, 2010 10:23 PM

  • Hi I'm new to WCF.. I'm trying to invoke free web service
    

    http://www.mindreef.net/svc/hashservice/servicesHashClassSoap?wsdl....

    So i have created a client but it gives me an exception..Please help me

    Could not connect to http://localhost:8050/hashservice/services/HashClassSoap.
    
    
    TCP error code 10061: No connection could be made because the target machine 
    
    
    actively refused it 127.0.0.1:8050. 
    
    Server stack trace: 
     at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
     at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.
    
    
    HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.RequestChannel.Request(Message message,
    
    
     TimeSpan timeout)
     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message,
    
    
     TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean 
    
    
    oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan
    
    
     timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action,
    
    
     Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(
    
    
    IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    
    Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,
    
    
     IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,
    
    
     Int32 type)
     at HashClassSoap.CheckHash(CheckHashRequest request)
     at HashClassSoapClient.HashClassSoap.CheckHash(CheckHashRequest request)
    
    
    
    

  • you have added your wcf reference by selecting wcf project node. to resolve it select your test project node and add wcf reference. i hope it will work.

  • you have added your wcf reference by selecting wcf project node. to resolve it select your test project node and add wcf reference. i hope it will work.

  • Yeah! First time I ever fixed ANYTHING! Error went away when changed properties of project to use IIS instead of local directory.  Set the project to use IIS, click the button to create a virtual directory and…c’est voila!.  Good luck.

  • TrollSpouse, I seem to have this problem, but I don’t understand the solution you found. Could you be more specific where in properties you configured  to use IIS instead of local directory? Thanks.

  • Make sure that «Net.Tcp Listener» is running go to  ControlPanel/Administrative Tools/Services
    also «Net.Tcp Port Sharing»  Service.

    • Proposed as answer by
      M.El-Baz
      Saturday, October 22, 2016 5:57 PM

  • My Net.tcp listener shows as starting, however starts… it shows the net.tcp Port Sharing as started, as well as the Windows Process Activation Service as started… i get the 10061 error as well… any idea how I can fix this?  would a service admin
    logon do it versus Local System/Service?

  • did you find the solution I have the same problem «TCP error code 10061: No connection could be made because the target machine actively refused it.

    when the service and application on the same PC its working fine but when I deployed the client application on another pc, i got the above error.

  • I’m quite interested in this as well, as I’ve got the same issue. I had my WCF service, that uses TCP for the transport protocol, on a Windows 2003 R2 Server. We’re writing a WPF application. It works fine for me, but no other user can run it. So in an
    effort to try and figure out what’s wrong I am now running the WCF service on my machine (a Windows 7 Ultimate machine). I’ve put the WCF service into IIS. I made sure the Windows Firewall allows for the port I want to use (9000). But I started getting these,
    «No connection could be made because the target machine actively refused it» and then it gives my machine’s IP address. I saw back in 2011 that Ivendur suggested making sure that Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service services both be running.
    They weren’t on my machine, but they are now, and that didn’t resolve the issue, I’m still getting that actively refused error message.


    Rod

  • I am receiving the same error when i  try to connect 2 clients to the same server.

    I make myself clear…

    i created a lan chat program that works just fine with 1 server form who listens (I used TPCListener) on 8080, and 1 client form that connects to it

    but if i try to open another client form and connect to the same server form at 8080 i get the error…

    i believed that, since the 2 clients use a different port to connect to localost:8080 the socket should not give an error…

    I don’t know how to solve this!


    +++ Alex +++

  • VMWARE Virtual network can cause such a problem (happened to me) — ‘Restore Defaults’ is the solution!


    Di-ma-N

  • For mine, I had to go into my router settings and use port forwarding.

  • It can be that if your server where AGPM client is started was an AGPM server before, that still these settings are used and therefore point to a wrong server. Just delete all entries of HKEY_LOCAL_MACHINESOFTWAREMicrosoftAgpm and below only enter the
    two following strings:

    DefaultArchive = AGPMServerName.company.com:4600
    InstallDirClient = C:Program FilesMicrosoftAGPMClient

    Note that «AGPMServerName.company.com» is the FQDN-name of the AGPM server. If you have another port than 4600 and/or another installation directory of your client, please adapt it (hust check before you delete anything).

  • I got similar error, I had to reboot the web server.

    Could not connect to net.tcp://testwe01/Services/Jse.EquitySystem.DataService/PricesDataService.svc

    The connection attempt lasted for a time span of 00:00:01.0312568. TCP error code 10061: No connection could be made because the target machine actively refused it xx.xx.xx.xxx:808.

  • I hosted a wcf service application using windows services. When my client (ASP.NET) tries to call the service class hosted by the windows service, I get this error «TCP error code 10061: No connection could be made because the target machine actively
    refused it. «. Is there a fix for this? The same code works fine if I host it using a console application.

    https://hipmusic.co/

    • Edited by
      HezekiahNig
      Thursday, July 25, 2019 11:20 PM

Понравилась статья? Поделить с друзьями:
  • Error while getting interface flags no such device как устранить
  • Error while compiling statement failed nullpointerexception null hive
  • Error while get mqtt config
  • Error while compiling resources compile with vd for more details check for duplicates
  • Error while fetching metadata with correlation id