I discovered the following script provided by nixcraft:
This script does not work with mysql passwords that have spaces in them. I fixed it by changing the occurance of:
Two places to change this, line 55 and 73. It would be cool if the script was updated.Code:-p$MyPASS to: -p"$MyPASS"