Fixed order of user, database and role creation

@domcleal could you please review? It's basically the same version you tested just without comments.