Skip to content

Commit e7ea5aa

Browse files
committed
feat: do not require MySQL's RELOAD privilege just for opening the user manager
See https://www.heidisql.com/forum.php?t=44896
1 parent a41d2dd commit e7ea5aa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/usermanager.pas

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,13 @@ procedure TUserManagerForm.FormShow(Sender: TObject);
368368
tmp := FConnection.GetSessionVariable('skip_name_resolve');
369369
SkipNameResolve := LowerCase(tmp) = 'on';
370370

371-
FConnection.Query(qReloadPrivileges);
371+
try
372+
FConnection.Query(qReloadPrivileges);
373+
except
374+
// FLUSH PRIVILEGE may fail due to missing RELOAD privilege.
375+
// Proceed anyway, it's still ok to read/see the users
376+
on E:EDbError do;
377+
end;
372378

373379
// Peek into user table structure, and find out where the password hash is stored
374380
UserTableColumns := FConnection.GetCol('SHOW COLUMNS FROM '+FConnection.QuoteIdent('mysql')+'.'+FConnection.QuoteIdent('user'));

0 commit comments

Comments
 (0)