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

Missing username in error 1044 Access denied for user ''@'localhost'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.1.21
    • Fix Version/s: N/A
    • Component/s: Server
    • Labels:
      None

      Description

      When a connection is made to a database with (1) a non-existent user, (2) an empty password, and (3) the database allows access for the user with an empty name, the error message changes from 1045 to 1044 and is missing the username.

      Reproducible on Windows and Linux.

      This leads to a lot of wasted time and confusion regarding the username setting.

      Without the user ''@'localhost':

      >mysql -u user1234 mysql
      ERROR 1045 (28000): Access denied for user 'user1234'@'localhost' (using password: NO)
      

      Then add the user ''@'localhost' with no DB access rights:

      CREATE USER ''@'localhost';
      GRANT USAGE ON *.* TO ''@'localhost';
      FLUSH PRIVILEGES;
      

      >mysql -u user1234 mysql
      ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              rustyx Rustam Abdullaev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: