Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33554

Upgrade from 11.2 to 11.3 changes root's privileges restricting GRANT ALL

    XMLWordPrintable

Details

    Description

      Freshly created MariaDB versions 11.2 and 11.3 works OK. Podman is used in the examples, but it's the same with the Docker. Images are from Docker Hub:

      podman run -d -ti --env MARIADB_ROOT_PASSWORD=manager --name mariadb112 mariadb:11.2
      podman exec -it mariadb112 bash                                                                                           
      root@9d0b8edb089e:/# mariadb -pmanager
       
      MariaDB [(none)]> show grants for root@'%';
      +--------------------------------------------------------------------------------------------------------------------------------+
      | Grants for root@%                                                                                                              |
      +--------------------------------------------------------------------------------------------------------------------------------+
      | GRANT ALL PRIVILEGES ON *.* TO `root`@`%` IDENTIFIED BY PASSWORD '*7D2ABFF56C15D67445082FBB4ACD2DCD26C0ED57' WITH GRANT OPTION |
      | GRANT PROXY ON ''@'%' TO 'root'@'%' WITH GRANT OPTION                                                                          |
      +--------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.000 sec)
      

      podman run -d -ti --env MARIADB_ROOT_PASSWORD=manager --name mariadb113 mariadb:11.3
      podman exec -it mariadb113 bash
      root@746a6dc0605e:/# mariadb -pmanager
       
      MariaDB [(none)]> show grants for root@'%';
      +--------------------------------------------------------------------------------------------------------------------------------+
      | Grants for root@%                                                                                                              |
      +--------------------------------------------------------------------------------------------------------------------------------+
      | GRANT ALL PRIVILEGES ON *.* TO `root`@`%` IDENTIFIED BY PASSWORD '*7D2ABFF56C15D67445082FBB4ACD2DCD26C0ED57' WITH GRANT OPTION |
      | GRANT PROXY ON ''@'%' TO 'root'@'%' WITH GRANT OPTION                                                                          |
      +--------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.000 sec)
      

      However, upgrading from 11.2 to 11.3 causes this:

      podman run -d -ti --env MARIADB_ROOT_PASSWORD=manager --name mariadb11 -v mariadb:/var/lib/mysql mariadb:11.2
      podman exec -it mariadb11 bash
      root@3f0e6649e7b1:/# mariadb -pmanager
       
      MariaDB [(none)]> show grants for root@'%';
      +--------------------------------------------------------------------------------------------------------------------------------+
      | Grants for root@%                                                                                                              |
      +--------------------------------------------------------------------------------------------------------------------------------+
      | GRANT ALL PRIVILEGES ON *.* TO `root`@`%` IDENTIFIED BY PASSWORD '*7D2ABFF56C15D67445082FBB4ACD2DCD26C0ED57' WITH GRANT OPTION |
      | GRANT PROXY ON ''@'%' TO 'root'@'%' WITH GRANT OPTION                                                                          |
      +--------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.000 sec)
      

      Exit container and continue with:

      podman rm -f mariadb11
      podman run -d -ti --env MARIADB_ROOT_PASSWORD=manager --name mariadb11 -v mariadb:/var/lib/mysql mariadb:11.3
      podman exec -it mariadb11 bash
      root@ad62bd011ef3:/# mariadb -pmanager
       
      MariaDB [(none)]> show grants for root@'%';
      +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Grants for root@%                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
      +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `root`@`%` IDENTIFIED BY PASSWORD '*7D2ABFF56C15D67445082FBB4ACD2DCD26C0ED57' WITH GRANT OPTION |
      | GRANT PROXY ON ''@'%' TO 'root'@'%' WITH GRANT OPTION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
      +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.000 sec)
      

      This change stays even after running mariadb-upgrade command.

      This is then causing errors such as

      Error granting privileges, invalid priv string: ALL , params: ('sometest', '%'), query: GRANT ALL ON `sometest`.* TO %s@%s , exception: (1044, \"Access denied for user 'root'@'%' to database 'sometest'\").
      

      The issue was also discussed here: https://github.com/ansible-collections/community.mysql/issues/462

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              pschiffe Peter Schiffer
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.