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

Confusing message with ALTER USER ... PASSWORD('newpass') command

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5
    • 10.4, 10.5
    • None
    • None

    Description

      When trying to change the authentication plugin one can get an generic error which does not provide any useful information.

      In this case the returned error is:

      ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
      

      while it should be:

      ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
      


      Example: With freshly installed 10.5 the root is identified via unix_socket

      MariaDB [(none)]> SHOW GRANTS;
      +------------------------------------------------------------------------------------------------+
      | Grants for root@localhost                                                                      |
      +------------------------------------------------------------------------------------------------+
      | GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED VIA unix_socket WITH GRANT OPTION |
      | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION                                  |
      +------------------------------------------------------------------------------------------------+
      

      ALTER attempt results in:

      MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('password');
      ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
      

      The error is not informative because the problem actually is with pasword not satisfying password check plugins so the following works:

      MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('1_Password_password');
      Query OK, 0 rows affected (0.009 sec)
       
      MariaDB [(none)]> SHOW GRANTS;
      +----------------------------------------------------------------------------------------------------------------------------------------+
      | Grants for root@localhost                                                                                                              |
      +----------------------------------------------------------------------------------------------------------------------------------------+
      | GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` IDENTIFIED BY PASSWORD '*B3D4E1ED7AF203404648B1010BBE3F5C41B8FC39' WITH GRANT OPTION |
      | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION                                                                          |
      +----------------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.000 sec)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            salle Alexander Keremidarski
            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.