update sql and privilege