It looks like your problem isn't in the python script. The mysql database refuses a connection. Have you set the username/password for the database so it matches what you're trying to connect to it with (i.e. 'testuser' & 'testpass')? If you have no clue on what I'm talking about, or have not set these, most probably the valid username will be 'root' without a password.
Thanks Jack, I kinda have an idea(i.e. that I need to set my username and password), but don't have a clue where to go and set the username/password. Is there an existing file in mysql where I can make the changes or do I need to create one? I poked around in the Winmysqladmin, frankly it looked like a jungle in there...
I have no clue :P Seriously, I run MySQL on my pc, and since I'm not all that familiar with it, I just leave it running and connect to it on localhost (I'm using it in combination with PHP to design webscripts) under root. This isn't exactly the safest way if you want to run it on a webserver or anything though.
I would refer you to http://www.mysql.com in order to find the information you seek, but I must admit that that site isn't the greatest of reference sites.
If you run both the MySQL engine and the program you're writing on your own computer (localhost), I'd say use root without a password.
You are right, using 'root' as user worked. I don't log in in when running MySQl, which means, I'm told, I am accessing the server via the default(root)route. I also had to leave the password parameter as an empty string.