in reply to Connection to mySQL

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.