other scripts of mine that connect to the same server seem to work ok. It should be alright really because the script works for my client, I am just worried about my server, but if the other scripts work then maybe this is just a glitch!
Try specifying the server as localhost:3306. Your program might be too smart for its own good and trying to connect via a filesocket when you don't have r/w access to it.