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

Cannot connect via socket until server restarts after `FLUSH PRIVILEGES`

    XMLWordPrintable

    Details

      Description

      I only tested mariadb-10.5.9:

      Create the server like

      testuser@system ~ $ mkdir /tmp/flush-privs-test-data
      testuser@system ~ $ mysql_install_db --no-defaults --skip-grant-tables --skip-networking --datadir=/tmp/flush-privs-test-data
      testuser@system ~ $ mysqld --no-defaults --skip-grant-tables --skip-networking --datadir=/tmp/flush-privs-test-data --socket=/tmp/flush-privs-test-data.socket
      

      In another terminal run

      testuser@system ~ $ mysql --socket=/tmp/flush-privs-test-data.socket -u root -e 'SELECT USER()'
      +--------+
      | USER() |
      +--------+
      | root@  |
      +--------+
      testuser@system ~ $ mysql --socket=/tmp/flush-privs-test-data.socket -e 'FLUSH PRIVILEGES'
      testuser@system ~ $ mysql --socket=/tmp/flush-privs-test-data.socket -u root -e 'SELECT USER()'
      ERROR 1698 (28000): Access denied for user 'root'@'localhost'
      testuser@system ~ $ mysql --socket=/tmp/flush-privs-test-data.socket -e 'SELECT USER()'
      +--------------------+
      | USER()             |
      +--------------------+
      | testuser@localhost |
      +--------------------+
      

      If I can connect as root through socket at the beginning, "FLUSH PRIVILEGES" shouldn't change anything. But if it should change anything, I shouldn't be able to connect again as root after restarting the server.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            whissi Thomas Deutschmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: