Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I've a question which has already appeared on your forum once (although no real answer was found). Basically, I'm running Perl and mySQL locally under Windows 2000 so I can develop my website offline. When I try to run ANY perl script which accesses mySQL, I get "CAN'T CREATE IP SOCKET" as the error report.

I have tried installing everything under windows 98, and it works no problems. It seems to be only under windows 2000 I get this problem (at home and at work actually).

Please can someone shed light on this. I'm afraid I'm gonna eventually go 'postal' over this (I have seen this exact error posted ALL over the place and was told to come here to ask too, as nobody else seems to have the answer!)

Cheers,
JT

Edit by tye to preserve formatting

Replies are listed 'Best First'.
Re: Connection to mySQL
by thunders (Priest) on Sep 22, 2002 at 15:44 UTC

    go to the /mysql/bin folder on your system. start the program called winmysqladmin. after starting this you will see a stoplight icon on the taskbar with a green light lit up. try to rerun your script. If it still doesn't work click on the stoplight icon and click "show me" this will give you a list of the current settings for mysql, One major one is host which in my case is "localhost via TCP/IP"

    In any case for mysql to be open for connections you must start it via this tool or install it as a service.

Re: Connection to mySQL
by Aristotle (Chancellor) on Sep 22, 2002 at 15:19 UTC
    This doesn't sound like a Perl problem. Can you access your mySQL database with any of its own tools? I'm pretty confident it's a problem with permissions in the mySQL database, which has not a thing to do with the Perl scripts you're trying to access it with.

    Makeshifts last the longest.

Re: Connection to mySQL
by JonnyThunder (Initiate) on Sep 24, 2002 at 16:34 UTC
    FYI, The problem is now solved. Because I'm fairly new to this stuff, I made the terrible mistake of trying to run my first Perl / SQL script from an editor. Big mistake. If any of you out there have had this problem (Can't Create IP Socket) then I suggest you do the following.... 1. Make sure Perl and mYSQL are installed in the default location on C:\mySQL and c:\Perl. 2. Make sure you have loaded the DBI / DBD-mySQL modules for Perl (using the PPM INSTALL utility). Also make sure you're not having firewall interruption. 3. If you've done all this and you still get a socket IP thing coming up, make sure you've tested your perl script from the command prompt. Do this by typing "Perl PROGRAMNAME". If you are using an editor, it may not give the same results as running from command prompt (DZ Perl Editor v3 for instance, will give the IP socket error testing under Windows 2000, but not Windows 98). Right. Thanks for your input guys. Now all I gotta do is learn mySQL. Damnit. JT p.s. Thanks to CTB and HERO from DevShed for also suggesting many things.
Re: Connection to mySQL
by JonnyThunder (Initiate) on Sep 22, 2002 at 19:18 UTC
    Hi there, (I originally posted this topic FYI!!) Yeah, it's not a problem with mySQL. I can access and work happily with SQL databases. In fact, I've already designed the databases on my local machine using MyCC. I've heard this error is coming from within the DBI module, but don't know enough about it (obviously) to know for sure. When I install MySQL and Perl under Windows 98 on the same PC, it works no problem whatsoever. It just seems to be under Windows 2000. I've tried this on two independant machines and the same result appears on both of them. This is the order in which I set things up (under 98 and 2k)... 1. Install ActivePerl 5.6.1.633 2. Install DBI and DBD-mySQL modules for Perl (latest from CPAN) 3. Install mySQL 4. Installed mySQL service and started (running fine) 5. Try my program. The wierdest thing about this is that it all works no problem under 98. I've heard of people using the same development environment as I am, that have no probs under 2K. Any more ideas? Thanks, JT
Re: Connection to mySQL
by Anonymous Monk on Sep 22, 2002 at 21:00 UTC
    I had the same problem. Try checking START ->PROGRAMS->ADMINISTRATIVE TOOLS->SERVICES and seeing if mysql is set to start automaticly. Also, I seem to remember mysql on windows did not like anoymous log ins. Make sure your DBI connection includes the actual user name and password. Hope this helps
Re: Connection to mySQL
by JonnyThunder (Initiate) on Sep 22, 2002 at 22:08 UTC
    Thanks for the response. Unfortunately, the login credentials don't matter. The process of communication with mySQL doesn't get that far. The same test script I use on mine, works on other machines. If the DBI module were working correctly and it was mySQL that was having issues with login, it would report an error such as "Username/Password wrong" - I've had other people test the script even though they didn't have the database installed. But i can't even get THAT error up! :)
Re: Connection to mySQL
by Hero Zzyzzx (Curate) on Sep 23, 2002 at 14:23 UTC

    Do you have any firewall software installed? Does win2k come with a default firewall? (I don't know, I don't use windows too much.) Not being able to create TCP/IP packets sounds like your firewall might be meddling here.

    -Any sufficiently advanced technology is
    indistinguishable from doubletalk.