Fixed the mysql invocation parameters and input stream handling so that it can work in Windows (as well as Linux) environments.