Mysql fixing root passwordWhere is my mysql log on OS X?SSH hangs without password promptOpen Directory password expiration warningsssh hangs without password prompt — works in root or other accountsReset MySQL 5 root password on Mac OS XWill setting MySQL root password prevent it from autostarting?Snow Leopard connecting to Unbuntu 10.04 through Samba failure — need help fixingDecrypt Cisco VPN Group passwordMySQL - Access denied for user 'root'@'localhost' (using password: YES)mysqld_safe --skip-grant-tables exits before i can type mysql-u root to rest root password

Can fracking help reduce CO2?

Does Danger Sense work against invisible spellcasters?

Minimum value of 4 digit number divided by sum of its digits

Is there a way to detect if the current member function is operating on an lvalue or rvalue?

Where can i find the changelog of a snap package

Pulling the rope with one hand is as heavy as with two hands?

Binary Numbers Magic Trick

Are Boeing 737-800’s grounded?

How do I deal with a coworker that keeps changing the look of a report I'm building, without documenting the changes in a design template?

What is the difference between `a[bc]d` (brackets) and `ab,cd` (braces)?

Counterexample: a pair of linearly ordered sets that are isomorphic to subsets of the other, but not isomorphic between them

Is it possible to measure lightning discharges as Nikola Tesla?

Python: pythonic way to find last position in string that does not match regex

Confused by notation of atomic number Z and mass number A on periodic table of elements

Does jamais mean always or never in this context?

How to determine the actual or "true" resolution of a digital photograph?

Were there two appearances of Stan Lee?

Do I have an "anti-research" personality?

What's the polite way to say "I need to urinate"?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

How to figure out whether the data is sample data or population data apart from the client's information?

When India mathematicians did know Euclid's Elements?

Corner spot where three faces meet

Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?



Mysql fixing root password


Where is my mysql log on OS X?SSH hangs without password promptOpen Directory password expiration warningsssh hangs without password prompt — works in root or other accountsReset MySQL 5 root password on Mac OS XWill setting MySQL root password prevent it from autostarting?Snow Leopard connecting to Unbuntu 10.04 through Samba failure — need help fixingDecrypt Cisco VPN Group passwordMySQL - Access denied for user 'root'@'localhost' (using password: YES)mysqld_safe --skip-grant-tables exits before i can type mysql-u root to rest root password






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I guess I messed up the user table trying to update the password running something like



UPDATE mysql.user SET authentication_string='root' WHERE User='root';


without flushing privileges. Now I'm basically locked out and I cannot connect to mysql cli even if I try



sudo mysqld_safe --skip-grant-tables &


There is a way I can safely remove all mysql databases including user table?



(MacOS mojave)



This is the content of /usr/local/bin related to mysql



mysql mysqladmin mysqlpump
mysql.server mysqlbinlog mysqlrouter
mysql_client_test mysqlcheck mysqlrouter_plugin_info
mysql_config mysqld mysqlshow
mysql_config_editor mysqld_multi mysqlslap
mysql_secure_installation mysqld_safe mysqltest
mysql_ssl_rsa_setup mysqldump mysqlxtest
mysql_tzinfo_to_sql mysqldumpslow
mysql_upgrade mysqlimport









share|improve this question






























    1















    I guess I messed up the user table trying to update the password running something like



    UPDATE mysql.user SET authentication_string='root' WHERE User='root';


    without flushing privileges. Now I'm basically locked out and I cannot connect to mysql cli even if I try



    sudo mysqld_safe --skip-grant-tables &


    There is a way I can safely remove all mysql databases including user table?



    (MacOS mojave)



    This is the content of /usr/local/bin related to mysql



    mysql mysqladmin mysqlpump
    mysql.server mysqlbinlog mysqlrouter
    mysql_client_test mysqlcheck mysqlrouter_plugin_info
    mysql_config mysqld mysqlshow
    mysql_config_editor mysqld_multi mysqlslap
    mysql_secure_installation mysqld_safe mysqltest
    mysql_ssl_rsa_setup mysqldump mysqlxtest
    mysql_tzinfo_to_sql mysqldumpslow
    mysql_upgrade mysqlimport









    share|improve this question


























      1












      1








      1








      I guess I messed up the user table trying to update the password running something like



      UPDATE mysql.user SET authentication_string='root' WHERE User='root';


      without flushing privileges. Now I'm basically locked out and I cannot connect to mysql cli even if I try



      sudo mysqld_safe --skip-grant-tables &


      There is a way I can safely remove all mysql databases including user table?



      (MacOS mojave)



      This is the content of /usr/local/bin related to mysql



      mysql mysqladmin mysqlpump
      mysql.server mysqlbinlog mysqlrouter
      mysql_client_test mysqlcheck mysqlrouter_plugin_info
      mysql_config mysqld mysqlshow
      mysql_config_editor mysqld_multi mysqlslap
      mysql_secure_installation mysqld_safe mysqltest
      mysql_ssl_rsa_setup mysqldump mysqlxtest
      mysql_tzinfo_to_sql mysqldumpslow
      mysql_upgrade mysqlimport









      share|improve this question
















      I guess I messed up the user table trying to update the password running something like



      UPDATE mysql.user SET authentication_string='root' WHERE User='root';


      without flushing privileges. Now I'm basically locked out and I cannot connect to mysql cli even if I try



      sudo mysqld_safe --skip-grant-tables &


      There is a way I can safely remove all mysql databases including user table?



      (MacOS mojave)



      This is the content of /usr/local/bin related to mysql



      mysql mysqladmin mysqlpump
      mysql.server mysqlbinlog mysqlrouter
      mysql_client_test mysqlcheck mysqlrouter_plugin_info
      mysql_config mysqld mysqlshow
      mysql_config_editor mysqld_multi mysqlslap
      mysql_secure_installation mysqld_safe mysqltest
      mysql_ssl_rsa_setup mysqldump mysqlxtest
      mysql_tzinfo_to_sql mysqldumpslow
      mysql_upgrade mysqlimport






      mac-osx






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 56 mins ago







      alfredopacino

















      asked 1 hour ago









      alfredopacinoalfredopacino

      118116




      118116




















          3 Answers
          3






          active

          oldest

          votes


















          2














          First backup your /etc/mysql and /var/lib/mysql directories.



          Then try to initalize



          mysql_install_db


          to recreate the mysql schema from scratch.



          You can read about it here: https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html






          share|improve this answer








          New contributor




          Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

            – alfredopacino
            1 hour ago












          • what whereis mysql says?

            – Comar
            1 hour ago











          • which mysql prints /usr/local/bin/mysql (whereis prints nothing)

            – alfredopacino
            59 mins ago











          • Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

            – Comar
            56 mins ago












          • I edited the question with my mysql bins in /usr/local/bin if it helps

            – alfredopacino
            54 mins ago


















          0














          You could simply uninstall mysql and purge configuration files if you don't need the databases or any settings.



          The steps would be:



          brew uninstall mysql
          brew cleanup
          sudo rm -rf /usr/local/var/mysql ## verify within my.cnf


          ps. Take this with a grain of salt, as I'm not a MacOS user.






          share|improve this answer























          • I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

            – alfredopacino
            47 mins ago












          • ok even removing /usr/local/var/mysql didn't solved..

            – alfredopacino
            41 mins ago


















          0














          I got the problem, basically almost all the solution you can find around are outdated.
          With mysql 8.0.15 you have to follow this guide
          https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html



          Using the method UPDATE mysql.user SET authentication_string.. will lock you out from your own mysql server (you won't solve even with mysqld_safe --skip-grant-tables).





          share























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964975%2fmysql-fixing-root-password%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            First backup your /etc/mysql and /var/lib/mysql directories.



            Then try to initalize



            mysql_install_db


            to recreate the mysql schema from scratch.



            You can read about it here: https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html






            share|improve this answer








            New contributor




            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















            • I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

              – alfredopacino
              1 hour ago












            • what whereis mysql says?

              – Comar
              1 hour ago











            • which mysql prints /usr/local/bin/mysql (whereis prints nothing)

              – alfredopacino
              59 mins ago











            • Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

              – Comar
              56 mins ago












            • I edited the question with my mysql bins in /usr/local/bin if it helps

              – alfredopacino
              54 mins ago















            2














            First backup your /etc/mysql and /var/lib/mysql directories.



            Then try to initalize



            mysql_install_db


            to recreate the mysql schema from scratch.



            You can read about it here: https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html






            share|improve this answer








            New contributor




            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















            • I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

              – alfredopacino
              1 hour ago












            • what whereis mysql says?

              – Comar
              1 hour ago











            • which mysql prints /usr/local/bin/mysql (whereis prints nothing)

              – alfredopacino
              59 mins ago











            • Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

              – Comar
              56 mins ago












            • I edited the question with my mysql bins in /usr/local/bin if it helps

              – alfredopacino
              54 mins ago













            2












            2








            2







            First backup your /etc/mysql and /var/lib/mysql directories.



            Then try to initalize



            mysql_install_db


            to recreate the mysql schema from scratch.



            You can read about it here: https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html






            share|improve this answer








            New contributor




            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.










            First backup your /etc/mysql and /var/lib/mysql directories.



            Then try to initalize



            mysql_install_db


            to recreate the mysql schema from scratch.



            You can read about it here: https://dev.mysql.com/doc/refman/5.6/en/mysql-install-db.html







            share|improve this answer








            New contributor




            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            share|improve this answer



            share|improve this answer






            New contributor




            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.









            answered 1 hour ago









            ComarComar

            813




            813




            New contributor




            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





            New contributor





            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            Comar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.












            • I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

              – alfredopacino
              1 hour ago












            • what whereis mysql says?

              – Comar
              1 hour ago











            • which mysql prints /usr/local/bin/mysql (whereis prints nothing)

              – alfredopacino
              59 mins ago











            • Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

              – Comar
              56 mins ago












            • I edited the question with my mysql bins in /usr/local/bin if it helps

              – alfredopacino
              54 mins ago

















            • I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

              – alfredopacino
              1 hour ago












            • what whereis mysql says?

              – Comar
              1 hour ago











            • which mysql prints /usr/local/bin/mysql (whereis prints nothing)

              – alfredopacino
              59 mins ago











            • Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

              – Comar
              56 mins ago












            • I edited the question with my mysql bins in /usr/local/bin if it helps

              – alfredopacino
              54 mins ago
















            I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

            – alfredopacino
            1 hour ago






            I do not have both those dirs. And I get command not found launching mysql_install_db. It is a fresh installation I don't have any db I have to save. I don't mind wiping up the whole mysql installation. But I'm not clear what to do other than uninstall using brew

            – alfredopacino
            1 hour ago














            what whereis mysql says?

            – Comar
            1 hour ago





            what whereis mysql says?

            – Comar
            1 hour ago













            which mysql prints /usr/local/bin/mysql (whereis prints nothing)

            – alfredopacino
            59 mins ago





            which mysql prints /usr/local/bin/mysql (whereis prints nothing)

            – alfredopacino
            59 mins ago













            Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

            – Comar
            56 mins ago






            Ah, my mistake, I have confused OS. Look for mysql configuration, binaries and files somewhere inside /usr/local, you may try to use locate mysql for this job.

            – Comar
            56 mins ago














            I edited the question with my mysql bins in /usr/local/bin if it helps

            – alfredopacino
            54 mins ago





            I edited the question with my mysql bins in /usr/local/bin if it helps

            – alfredopacino
            54 mins ago













            0














            You could simply uninstall mysql and purge configuration files if you don't need the databases or any settings.



            The steps would be:



            brew uninstall mysql
            brew cleanup
            sudo rm -rf /usr/local/var/mysql ## verify within my.cnf


            ps. Take this with a grain of salt, as I'm not a MacOS user.






            share|improve this answer























            • I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

              – alfredopacino
              47 mins ago












            • ok even removing /usr/local/var/mysql didn't solved..

              – alfredopacino
              41 mins ago















            0














            You could simply uninstall mysql and purge configuration files if you don't need the databases or any settings.



            The steps would be:



            brew uninstall mysql
            brew cleanup
            sudo rm -rf /usr/local/var/mysql ## verify within my.cnf


            ps. Take this with a grain of salt, as I'm not a MacOS user.






            share|improve this answer























            • I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

              – alfredopacino
              47 mins ago












            • ok even removing /usr/local/var/mysql didn't solved..

              – alfredopacino
              41 mins ago













            0












            0








            0







            You could simply uninstall mysql and purge configuration files if you don't need the databases or any settings.



            The steps would be:



            brew uninstall mysql
            brew cleanup
            sudo rm -rf /usr/local/var/mysql ## verify within my.cnf


            ps. Take this with a grain of salt, as I'm not a MacOS user.






            share|improve this answer













            You could simply uninstall mysql and purge configuration files if you don't need the databases or any settings.



            The steps would be:



            brew uninstall mysql
            brew cleanup
            sudo rm -rf /usr/local/var/mysql ## verify within my.cnf


            ps. Take this with a grain of salt, as I'm not a MacOS user.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 52 mins ago









            LeoLeo

            1,430415




            1,430415












            • I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

              – alfredopacino
              47 mins ago












            • ok even removing /usr/local/var/mysql didn't solved..

              – alfredopacino
              41 mins ago

















            • I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

              – alfredopacino
              47 mins ago












            • ok even removing /usr/local/var/mysql didn't solved..

              – alfredopacino
              41 mins ago
















            I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

            – alfredopacino
            47 mins ago






            I would avoid mess up the whole sistem, I will search around a little bit. macOS it's a f nightmare...

            – alfredopacino
            47 mins ago














            ok even removing /usr/local/var/mysql didn't solved..

            – alfredopacino
            41 mins ago





            ok even removing /usr/local/var/mysql didn't solved..

            – alfredopacino
            41 mins ago











            0














            I got the problem, basically almost all the solution you can find around are outdated.
            With mysql 8.0.15 you have to follow this guide
            https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html



            Using the method UPDATE mysql.user SET authentication_string.. will lock you out from your own mysql server (you won't solve even with mysqld_safe --skip-grant-tables).





            share



























              0














              I got the problem, basically almost all the solution you can find around are outdated.
              With mysql 8.0.15 you have to follow this guide
              https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html



              Using the method UPDATE mysql.user SET authentication_string.. will lock you out from your own mysql server (you won't solve even with mysqld_safe --skip-grant-tables).





              share

























                0












                0








                0







                I got the problem, basically almost all the solution you can find around are outdated.
                With mysql 8.0.15 you have to follow this guide
                https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html



                Using the method UPDATE mysql.user SET authentication_string.. will lock you out from your own mysql server (you won't solve even with mysqld_safe --skip-grant-tables).





                share













                I got the problem, basically almost all the solution you can find around are outdated.
                With mysql 8.0.15 you have to follow this guide
                https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html



                Using the method UPDATE mysql.user SET authentication_string.. will lock you out from your own mysql server (you won't solve even with mysqld_safe --skip-grant-tables).






                share











                share


                share










                answered 6 mins ago









                alfredopacinoalfredopacino

                118116




                118116



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964975%2fmysql-fixing-root-password%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown