Looks like your SQL username isn't properly configured. 'sparky@localhost' is being denied access to the SQL database - you're using no password ("(Using password: NO)"), so my guess would be is that you need one...and if you don't actually use a password I'd HIGHLY suggest you do.
That could be causing all the other errors, or possibly not - I don't know, I didn't write the code.
