Fix database user creation and permission granting