It looks like the environment variables you're expecting to see are set up in .bashrc. Non-interactive bash shells don't run .bashrc. Plus, you don't seem to be running bash (though you might be, I can't see the shebang in mysql-setup.sh).
You can familiarize yourself with how remote execs and non-interactive shells work by reading `man bash`; the section titled "Invocation" has all the details.