MT#8117 ngcp-update-db-schema: add mysql sipwise user connection check

changes/61/61/1
Victor Seva 11 years ago
parent 5f60f7d4ea
commit b7f74b0737

@ -63,6 +63,12 @@ else
fi
fi
# check connection with sipwise user
if ! mysql -usipwise -p${SIPWISE_DB_PASSWORD} -e 'SELECT 1;' 1>/dev/null 2>/dev/null ; then
echo 'Error: cant connect to local MySQL with sipwise user' >&2
exit 1
fi
if ! mysql -usipwise -p${SIPWISE_DB_PASSWORD} -e 'use ngcp;' 2>/dev/null ; then
mysql -usipwise -p${SIPWISE_DB_PASSWORD} < /usr/share/ngcp-db-schema/db_scripts/init/0005_create_ngcp.up
fi

Loading…
Cancel
Save