Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7723351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:25:16+00:00 2026-06-01T04:25:16+00:00

I have the following code $env=array(‘PATH’=>’C:\Program Files\MySQL\MySQL Server 5.1\bin’, ‘PATHEXT’ => ‘.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC’); $cmd=’mysql –port=3306

  • 0

I have the following code

$env=array('PATH'=>'C:\Program Files\MySQL\MySQL Server 5.1\bin',
           'PATHEXT' => '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC');
$cmd='mysql "--port=3306" "--host=127.0.0.1" "--user=root" "--password=xxxx" <"C:\Projects/script.sql" 2>&1';
print $cmd;
$proc = proc_open($cmd, $descriptorspec, $pipes, NULL, $env) or die("Cannot run $cmd");

while ($line=fgets($pipes[1])) print $line;

print "\n\nCompleted\n";

And the output I get is

ERROR 2004 (HY000): Can't create TCP/IP socket (10106)

Why is the port option being ignored? The command works perfectly well on the command line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:25:18+00:00Added an answer on June 1, 2026 at 4:25 am

    The error seen

    ERROR 2004 (HY000): Can't create TCP/IP socket (10106)
    

    is raised by mysql, so the mysql process actually started.

    This error corresponds to CR_IPSOCK_ERROR, and it prints the underlying root cause of the problem: 10106.

    A quick search gives:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ms740668%28v=vs.85%29.aspx

    and in particular:

    WSAEPROVIDERFAILEDINIT
    10106
    
    Service provider failed to initialize.
    The requested service provider could not be loaded or initialized. This error is returned if either a service provider's DLL could not be loaded (LoadLibrary failed) or the provider's WSPStartup or NSPStartup function failed.
    

    I don’t think this has anything to do with the port number being “ignored”, and even less firewall issues.

    It appears as if the environment created by proc_open is good enough to start the mysql process, but yet not complete enough so that calls to LoadLibrary from within that process, to load the networking code namely, are failing.

    The same command works from the command line, most likely because the environment in the command line contains much more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: #!/usr/bin/env python import sys from PyQt4 import QtGui, QtCore
I have the following Python code: #!/usr/bin/env python2.6 class container(object): name = 'container' configuration
I have the following code: #!/usr/bin/env perl for ($str = <>; $str != '`';
Suppose I have the following code: #!/usr/bin/env ruby -wKU h = {} h[[1, a]]
I have written a script in haskell named testscript with the following code: #!/usr/bin/env
I have the following code void reportResults() { wstring env(_wgetenv(LProgramFiles)); env += L\Internet Explorer\iexplore.exe;
I have the following code: $body = <SOAP-ENV:Envelope>.$data.</SOAP-ENV:Envelope>; $ch = curl_init($FD_Add); curl_setopt($ch, CURLOPT_POST, 1);
I have the following code: http://scrp.at/FB # Error: # bin/rpg:5:in `<main>': uninitialized constant RubyPasswordGenerator::Korben
I have following code: $telnums = array(10, 20, 30); $obj = new StdClass(); $obj->telnums
I have following code: <div class='parent'> <div class='left-child'></div> <div class=right-child></div> </div> What I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.