[MDEV-31426] Unable to grant "SLAVE MONITOR" on a database that was upgraded from 10.3 Created: 2023-06-07 Updated: 2023-06-08 Resolved: 2023-06-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | N/A |
| Affects Version/s: | 10.8.2, 10.6.12, 10.6.13 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Felix Bartels | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 22.04 with Mariadb packages from the Ubuntu repository (10.6.12 at the moment of writing) |
||
| Description |
|
I recently upgraded a system from Ubuntu 20.04 to 22.04 and through this upgraded the local mariadb server from 10.3.x to 10.6.x (through the packages from the ubuntu repository). In my setup I am using https://github.com/prometheus/mysqld_exporter to export metrics to prometheus and with the upgrade this is now failing with the following error message:
And while I am able to grant the "super" permission, whenever I try to grant "slave monitor" the permissions are actually not applied. This can easily reproduced with the below docker-compose.yml. As long as the database was initialised with 10.3 the slave monitor permissions cannot be granted, but when the database is initialised with 10.6 it is no problem to grant the permission. Steps to reproduce:
docker-compose.yml for testing:
|
| Comments |
| Comment by Felix Bartels [ 2023-06-07 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
The issue was also documented by another user at https://stackoverflow.com/questions/75112879/cant-grant-slave-monitor-to-user-on-mariadb-10-6-primary | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-06-07 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
The trick is to run the mariadb-upgrade. The 10.3 table structure for privileges is different from 10.4+. After upgrading the grants are migrated correctly. Docker Official Image containers can use MARIADB_AUTO_UPGRADE=1 to effect this.
note: its also a common misconception that FLUSH PRIVILEGES is required after grants/create user. It isn't. | ||||||||||||||||||||||||||||||||||||||||||||
| Comment by Felix Bartels [ 2023-06-08 ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Hi Daniel, thanks for your detailed reply. This was indeed the missing piece in my system. Ticket can be closed. |