Fixed database initialization

Fixed problem when root password is set before the server is ready