server/sql: flush privileges after modification
This commit is contained in:
@@ -42,7 +42,7 @@ on the MySQL server as the admin user (or another user with sufficient privilege
|
||||
```sql
|
||||
CREATE USER `muscl`@`localhost` IDENTIFIED BY '<strong_password_here>';
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON `mysql`.* TO `muscl`@`localhost`;
|
||||
GRANT GRANT OPTION, CREATE, DROP ON *.* TO `muscl`@`localhost`;
|
||||
GRANT GRANT OPTION, CREATE, DROP, RELOAD ON *.* TO `muscl`@`localhost`;
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
|
||||
@@ -487,6 +487,10 @@ pub async fn apply_privilege_diffs(
|
||||
results.insert(key, result);
|
||||
}
|
||||
|
||||
if let Err(err) = connection.execute("FLUSH PRIVILEGES").await {
|
||||
tracing::error!("Failed to flush privileges: {}", err);
|
||||
}
|
||||
|
||||
results
|
||||
.into_iter()
|
||||
.map(|((k1, k2), v)| (k1, (k2, v)))
|
||||
|
||||
Reference in New Issue
Block a user