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

MySQL Users Break when Migrating from MySQL 5.1 to MariaDB 10.0.10

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.0.10
    • 10.0.12
    • None
    • None

    Description

      I had MySQL installed and running. I created some users using HeidiSQL, a Windows MySQL GUI and verified that they worked. I then upgraded to MariaDB.

      Only my root accounts worked on MariaDB. When I checked the mysql.user table, the root accounts had empty `plugin` fields, but the non-root accounts had mysql_native_password in the field. Emptying the field and restarting the server (probably flushing privileges would have worked) resolved the issue.

      I am not sure what was in the field prior to the MariaDB migration, but after checking all the other servers I have that are running vanilla MySQL, it was probably blank. I use HeidiSQL to create all of those users and none of them have a populated plugin field .

      Attachments

        Activity

          axel Axel Schwenke added a comment -

          from #maria channel on Freenode

          <XL> metateck: have you run mysql_upgrade after the upgrade?
          <metateck> no i didnt
          <XL> metateck: see! you must always run mysql_upgrade after upgrading/downgrading/migrating a MySQL installation
          <metateck> yeah that is proabbly the entire cause of my bug report

          Please run mysql_upgrade and check if the problem is gone.

          axel Axel Schwenke added a comment - from #maria channel on Freenode <XL> metateck: have you run mysql_upgrade after the upgrade? <metateck> no i didnt <XL> metateck: see! you must always run mysql_upgrade after upgrading/downgrading/migrating a MySQL installation <metateck> yeah that is proabbly the entire cause of my bug report Please run mysql_upgrade and check if the problem is gone.

          I ran mysql_upgrade, but unfortunately I did not run this until I fixed the problem manually by emptying the plugin field. I do not have binary logging enabled so I am unable to supply that.

          metateck Clifford Keeney added a comment - I ran mysql_upgrade, but unfortunately I did not run this until I fixed the problem manually by emptying the plugin field. I do not have binary logging enabled so I am unable to supply that.

          Was it really from MySQL 5.1? There is no plugin field in the MySQL 5.1 privilege tables.

          serg Sergei Golubchik added a comment - Was it really from MySQL 5.1 ? There is no plugin field in the MySQL 5.1 privilege tables.

          It was definitely MySQL 5.1. However, I did not see the plugin field in the privilege table until after the migration. It is possible that this was just my fault for not running mysql_upgrade, but I don't know for sure.

          metateck Clifford Keeney added a comment - It was definitely MySQL 5.1. However, I did not see the plugin field in the privilege table until after the migration. It is possible that this was just my fault for not running mysql_upgrade, but I don't know for sure.

          FWIW - We've seen this upgrading from MySQL 5.6.13 to MariaDB 10.0.10. We've had to clear the plugin field for all rows in user table and FLUSH PRIVILEGES.

          cf-services-eng Pivotal CloudFoundry Services Team (Inactive) added a comment - FWIW - We've seen this upgrading from MySQL 5.6.13 to MariaDB 10.0.10. We've had to clear the plugin field for all rows in user table and FLUSH PRIVILEGES.
          metateck Clifford Keeney added a comment - - edited

          I'm feeling a little bad that this bug report is getting so much attention when I feel it was most likely just caused by my failure to run mysql_upgrade. cf-services-eng did you guys run mysql_upgrade when you encountered the issue?

          metateck Clifford Keeney added a comment - - edited I'm feeling a little bad that this bug report is getting so much attention when I feel it was most likely just caused by my failure to run mysql_upgrade. cf-services-eng did you guys run mysql_upgrade when you encountered the issue?

          This bug report is, basically, about MariaDB not allowing a user to connect, when the corresponding row in the mysql.user table has password and plugin fields set, but authentication_string empty.

          The original logic (still preserved in MariaDB) was simple: if the plugin field is not set (meaning old table), the server looks at the password field and implicitly uses mysql_native_password plugin. If the plugin field is set (new way, pluggable-auth compatible), the server uses plugin and authentication_string pair, and ignores the password field (the password is stored in the authentication_string).

          Now, it looks like Oracle broke this, in MySQL 5.6, plugin field contains "mysql_native_password", password is set, authentication_string is empty. In this case, MySQL 5.6 uses old style field password and a new style field plugin, but ignored new style field authentication_string. There's no logic in that.

          Still wonder, what we should do about this issue...

          serg Sergei Golubchik added a comment - This bug report is, basically, about MariaDB not allowing a user to connect, when the corresponding row in the mysql.user table has password and plugin fields set, but authentication_string empty. The original logic (still preserved in MariaDB) was simple: if the plugin field is not set (meaning old table), the server looks at the password field and implicitly uses mysql_native_password plugin. If the plugin field is set (new way, pluggable-auth compatible), the server uses plugin and authentication_string pair, and ignores the password field (the password is stored in the authentication_string ). Now, it looks like Oracle broke this, in MySQL 5.6, plugin field contains "mysql_native_password", password is set, authentication_string is empty. In this case, MySQL 5.6 uses old style field password and a new style field plugin , but ignored new style field authentication_string . There's no logic in that. Still wonder, what we should do about this issue...

          Hi metateck,

          We did try mysql_upgrade but that did not fix. I believe our issue is exactly what is described by serg above.

          cf-services-eng Pivotal CloudFoundry Services Team (Inactive) added a comment - Hi metateck , We did try mysql_upgrade but that did not fix. I believe our issue is exactly what is described by serg above.

          Thanks for the clarification. I didn't have a full understanding of the behavior I was experiencing but it does sound like a real bug to me now.

          metateck Clifford Keeney added a comment - Thanks for the clarification. I didn't have a full understanding of the behavior I was experiencing but it does sound like a real bug to me now.

          People

            serg Sergei Golubchik
            metateck Clifford Keeney
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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