Skip to content

Commit 09576dd

Browse files
committed
Missing privileges on the mysql.host table for the PMA controluser when that table exists
Missing privileges on the `mysql.user` table for the PMA `controluser` when the `mysql.host` table doesn't exists
1 parent c76a83a commit 09576dd

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 1.0.1 - TBD
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Changed
12+
13+
- Nothing.
14+
15+
### Deprecated
16+
17+
- Nothing.
18+
19+
### Removed
20+
21+
- Nothing.
22+
23+
### Fixed
24+
25+
- Missing privileges on the `mysql.host` table for the PMA `controluser` when that table exists
26+
- Missing privileges on the `mysql.user` table for the PMA `controluser` when the `mysql.host` table doesn't exists
27+
528
## 1.0.0 - 20190328
629

730
Initial release.

src/Handler.pm

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,6 @@ sub _setupSqlUser
475475
undef, $self->{'_pma_control_user'},
476476
$dbUserHost
477477
);
478-
$dbh->do(
479-
'GRANT SELECT ON mysql.db TO ?@?',
480-
undef, $self->{'_pma_control_user'},
481-
$dbUserHost
482-
);
483478
$dbh->do(
484479
'
485480
GRANT SELECT (
@@ -493,18 +488,30 @@ sub _setupSqlUser
493488
',
494489
undef, $self->{'_pma_control_user'}, $dbUserHost
495490
);
491+
492+
$dbh->do(
493+
'GRANT SELECT ON mysql.db TO ?@?',
494+
undef, $self->{'_pma_control_user'},
495+
$dbUserHost
496+
);
496497

497498
# Check for mysql.host table existence (as for MySQL >= 5.6.7, the
498499
# mysql.host table is no longer provided)
499500
if ( $dbh->selectrow_hashref( "SHOW tables FROM mysql LIKE 'host'" ) ) {
500501
$dbh->do(
501-
'GRANT SELECT ON mysql.user TO ?@?',
502+
'GRANT SELECT ON mysql.host TO ?@?',
502503
undef,
503504
$self->{'_pma_control_user'},
504505
$dbUserHost
505506
);
506507
}
507508

509+
$dbh->do(
510+
'GRANT SELECT ON mysql.user TO ?@?',
511+
undef,
512+
$self->{'_pma_control_user'},
513+
$dbUserHost
514+
);
508515
$dbh->do(
509516
'
510517
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)

0 commit comments

Comments
 (0)