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

Allow use of wildcard in hostname of grant on specific table

    XMLWordPrintable

Details

    Description

      I have a multi-tenant application that has one database for each tenant. These thousands of databases are distributed across multiple servers. I have a user who I want to apply table level SELECT,INSERT,UPDATE,DELETE on 6 tables in every database. We frequently add databases and move them between servers for maintenance tasks so maintaining these permissions for each database on each server becomes a significant maintenance task.

      I tried these, among others, and received the corresponding errors:

      [mysql] GRANT SELECT,INSERT,UPDATE,DELETE ON `%`.table TO 'user'@'host';
      ERROR 1146 (42S02): Table '%.table' doesn't exist
      [mysql] GRANT SELECT,INSERT,UPDATE,DELETE ON *.table TO 'user'@'host';
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'table TO 'user'@'host'' at line 1

      I also asked around the community and searched for existing bugs and feature requests in both mysql and mariadb bug tools and couldn't find a solution or bug report. I've been told that this would require scripting out the maintenance of the account as it is not supported.

      I was going to mark this Priority:Minor, but ended up with Major because there isn't an easy work around that I have been able to figure out for my use case. If that isn't appropriate please correct.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jritchie Josiah Ritchie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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