mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
catch exception if mysqld has not been started when
perform 'cloud-setup-database'
This commit is contained in:
parent
1433c3ad6c
commit
032f321363
@ -137,7 +137,13 @@ def run_mysql(text,user,password,host,port,debug=False):
|
||||
if password: kwargs['passwd'] = password
|
||||
if port: kwargs['port'] = port
|
||||
|
||||
conn = MySQLdb.connect(**kwargs)
|
||||
try:
|
||||
conn = MySQLdb.connect(**kwargs)
|
||||
except:
|
||||
print "Connect to mysqld failed, please make sure mysqld is running. \
|
||||
You may start it by: service mysqld start"
|
||||
sys.exit (-1)
|
||||
|
||||
cur = conn.cursor()
|
||||
import re
|
||||
exp = re.compile("DELIMITER (.*)$",re.M)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user