rewritten mysql.sh and split non-refactored code in install script