Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkMySQL():
- cmd = ('mysql --user=%s --password=%s -e "select 1+1;" > /dev/null')% (user, password)
- process = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
- process.wait()
- state = process.poll()
- if state > 0:
- print "MySQL not running. Exiting status(1)"
- sys.exit(1)
- else:
- print "continue..."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement