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

Extend CREATE USER statement to allow HEX strings

    XMLWordPrintable

Details

    • New Feature
    • Status: Needs Feedback (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None

    Description

      When migrating users from mysql to mariadb, the goal was to to migrate them to caching_sha2_password in mariadb with the same hashing so that the password's continue to work.

      However we are seeing that there may be hidden characters that may not port hence there is a need to convert them to HEX and create the user on the mariadb side with the HEX value.

      Example

       
      mysql> select hex(authentication_string) from mysql.user where user ='user1234';
      +----------------------------------------------------------------------------------------------------------------------------------------------+
      | hex(authentication_string)                                                                                                                   |
      +----------------------------------------------------------------------------------------------------------------------------------------------+
      | 244124303035242C7F5F732A1A13472B22173B1E070A167F6E3F793934312F7630482F57434747416F4F6C634B466A2F4151516867522F39626141364D6232686939714C6637 |
      +----------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      

      To use this on the mariadb side, we need to specify that a HEX value is being passed, so a syntax like this needs to be supported.

      CREATE USER IF NOT EXISTS 'user1234'@'localhost' IDENTIFIED VIA caching_sha2_password USING x'244124303035242C7F5F732A1A13472B22173B1E070A167F6E3F793934312F7630482F57434747416F4F6C634B466A2F4151516867522F39626141364D6232686939714C6637';

      and

      CREATE USER IF NOT EXISTS 'user1234'@'localhost' IDENTIFIED VIA caching_sha2_password USING 0x244124303035242C7F5F732A1A13472B22173B1E070A167F6E3F793934312F7630482F57434747416F4F6C634B466A2F4151516867522F39626141364D6232686939714C6637;

      Attachments

        Issue Links

          Activity

            People

              manoj.vakeel Manoj
              manoj.vakeel Manoj
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.