lubuntu - mariadb ignores correct password

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












This is a problem I got today when upgrading my Lubuntu version to 18.04. After the update, the system deleted my MariaDB packages. When I tried to installing them again the installer said the will move the current installation to another folder (so I'm not worried about data lost yet, but I need a way to import the data after I solve this.).



However, after I installed the new MariaDB package, it didn't prompt me to assign a root password (I assumed it would be the same as the previous installation) however I was wrong.



I searched the web about how to reset the root password, but after starting the service in --skip-grant-tables mode and then assigning a new password to my MariaDB database, I still couldn't log in after a reboot. (I needed to reboot since starting the service manually didn't work).



 ~$ mysql -u root -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'


I appreciate any help with this issue since it's hindering my work.







share|improve this question
























    up vote
    1
    down vote

    favorite












    This is a problem I got today when upgrading my Lubuntu version to 18.04. After the update, the system deleted my MariaDB packages. When I tried to installing them again the installer said the will move the current installation to another folder (so I'm not worried about data lost yet, but I need a way to import the data after I solve this.).



    However, after I installed the new MariaDB package, it didn't prompt me to assign a root password (I assumed it would be the same as the previous installation) however I was wrong.



    I searched the web about how to reset the root password, but after starting the service in --skip-grant-tables mode and then assigning a new password to my MariaDB database, I still couldn't log in after a reboot. (I needed to reboot since starting the service manually didn't work).



     ~$ mysql -u root -p
    Enter password:
    ERROR 1698 (28000): Access denied for user 'root'@'localhost'


    I appreciate any help with this issue since it's hindering my work.







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      This is a problem I got today when upgrading my Lubuntu version to 18.04. After the update, the system deleted my MariaDB packages. When I tried to installing them again the installer said the will move the current installation to another folder (so I'm not worried about data lost yet, but I need a way to import the data after I solve this.).



      However, after I installed the new MariaDB package, it didn't prompt me to assign a root password (I assumed it would be the same as the previous installation) however I was wrong.



      I searched the web about how to reset the root password, but after starting the service in --skip-grant-tables mode and then assigning a new password to my MariaDB database, I still couldn't log in after a reboot. (I needed to reboot since starting the service manually didn't work).



       ~$ mysql -u root -p
      Enter password:
      ERROR 1698 (28000): Access denied for user 'root'@'localhost'


      I appreciate any help with this issue since it's hindering my work.







      share|improve this question












      This is a problem I got today when upgrading my Lubuntu version to 18.04. After the update, the system deleted my MariaDB packages. When I tried to installing them again the installer said the will move the current installation to another folder (so I'm not worried about data lost yet, but I need a way to import the data after I solve this.).



      However, after I installed the new MariaDB package, it didn't prompt me to assign a root password (I assumed it would be the same as the previous installation) however I was wrong.



      I searched the web about how to reset the root password, but after starting the service in --skip-grant-tables mode and then assigning a new password to my MariaDB database, I still couldn't log in after a reboot. (I needed to reboot since starting the service manually didn't work).



       ~$ mysql -u root -p
      Enter password:
      ERROR 1698 (28000): Access denied for user 'root'@'localhost'


      I appreciate any help with this issue since it's hindering my work.









      share|improve this question











      share|improve this question




      share|improve this question










      asked May 3 at 15:35









      Gabriel I.

      185




      185




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Try to run it with sudo and without the password switch, like this



          sudo mysql -u root



          and enter your user's password normally when sudo asks for authentication.



          There is a specific reason for this because mariadb now is configured by default to use "Unix socket" authentication plugin so the "root" user of mariadb uses the same credentials as the OS "root" user.



          You can change this behaviour from the user configuration, but beware it can break other processes that rely on this or the installation of new software that uses MariaDB/MySQL.



          An alternative can be to setup a new user with the same privileges as root and set it to not use the socket authentication plugin, so you leave the root user untouched and you can login with an user and password.



          Hope it helps.



          References:



          • This Server Fault post

          • This SuperUser post





          share|improve this answer




















          • Thank you, it worked correctly. And also I successfully recovered the data I needed.
            – Gabriel I.
            May 3 at 16:07










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031609%2flubuntu-mariadb-ignores-correct-password%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          Try to run it with sudo and without the password switch, like this



          sudo mysql -u root



          and enter your user's password normally when sudo asks for authentication.



          There is a specific reason for this because mariadb now is configured by default to use "Unix socket" authentication plugin so the "root" user of mariadb uses the same credentials as the OS "root" user.



          You can change this behaviour from the user configuration, but beware it can break other processes that rely on this or the installation of new software that uses MariaDB/MySQL.



          An alternative can be to setup a new user with the same privileges as root and set it to not use the socket authentication plugin, so you leave the root user untouched and you can login with an user and password.



          Hope it helps.



          References:



          • This Server Fault post

          • This SuperUser post





          share|improve this answer




















          • Thank you, it worked correctly. And also I successfully recovered the data I needed.
            – Gabriel I.
            May 3 at 16:07














          up vote
          2
          down vote



          accepted










          Try to run it with sudo and without the password switch, like this



          sudo mysql -u root



          and enter your user's password normally when sudo asks for authentication.



          There is a specific reason for this because mariadb now is configured by default to use "Unix socket" authentication plugin so the "root" user of mariadb uses the same credentials as the OS "root" user.



          You can change this behaviour from the user configuration, but beware it can break other processes that rely on this or the installation of new software that uses MariaDB/MySQL.



          An alternative can be to setup a new user with the same privileges as root and set it to not use the socket authentication plugin, so you leave the root user untouched and you can login with an user and password.



          Hope it helps.



          References:



          • This Server Fault post

          • This SuperUser post





          share|improve this answer




















          • Thank you, it worked correctly. And also I successfully recovered the data I needed.
            – Gabriel I.
            May 3 at 16:07












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Try to run it with sudo and without the password switch, like this



          sudo mysql -u root



          and enter your user's password normally when sudo asks for authentication.



          There is a specific reason for this because mariadb now is configured by default to use "Unix socket" authentication plugin so the "root" user of mariadb uses the same credentials as the OS "root" user.



          You can change this behaviour from the user configuration, but beware it can break other processes that rely on this or the installation of new software that uses MariaDB/MySQL.



          An alternative can be to setup a new user with the same privileges as root and set it to not use the socket authentication plugin, so you leave the root user untouched and you can login with an user and password.



          Hope it helps.



          References:



          • This Server Fault post

          • This SuperUser post





          share|improve this answer












          Try to run it with sudo and without the password switch, like this



          sudo mysql -u root



          and enter your user's password normally when sudo asks for authentication.



          There is a specific reason for this because mariadb now is configured by default to use "Unix socket" authentication plugin so the "root" user of mariadb uses the same credentials as the OS "root" user.



          You can change this behaviour from the user configuration, but beware it can break other processes that rely on this or the installation of new software that uses MariaDB/MySQL.



          An alternative can be to setup a new user with the same privileges as root and set it to not use the socket authentication plugin, so you leave the root user untouched and you can login with an user and password.



          Hope it helps.



          References:



          • This Server Fault post

          • This SuperUser post






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 3 at 15:58









          badger_8007

          9317




          9317











          • Thank you, it worked correctly. And also I successfully recovered the data I needed.
            – Gabriel I.
            May 3 at 16:07
















          • Thank you, it worked correctly. And also I successfully recovered the data I needed.
            – Gabriel I.
            May 3 at 16:07















          Thank you, it worked correctly. And also I successfully recovered the data I needed.
          – Gabriel I.
          May 3 at 16:07




          Thank you, it worked correctly. And also I successfully recovered the data I needed.
          – Gabriel I.
          May 3 at 16:07












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1031609%2flubuntu-mariadb-ignores-correct-password%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491