Man, this brings back memories from when I was self-hosting my website!
These days, I would have done it a little differently. I would have created a mysql user, but I had only been using Linux for three years and what did I know? It was several years later that I worked up the nerve to try to answer a Linux Question.
Warning: This is a link to my own blog. I normally do not link to it on LQ because I'm not here to look for clicks, I'm here to learn Linux, but I think it's relevant to this thread, so I'm making an exception. If I erred, I expect a mod will give me guidance.
http://pineviewfarm.net/weblog/2008/...-script-fixed/