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

Gift for mentor after his thesis defense?

shebang or not shebang

What is the meaning of "matter" in physics?

What's the 2-minute timer on mobile Deutsche Bahn tickets?

Concatenate all values of the same XML element using XPath/XQuery

How could a humanoid creature completely form within the span of 24 hours?

GitLab account hacked and repo wiped

Why can’t you see at the start of the Big Bang?

The unknown and unexplained in science fiction

What is more safe for browsing the web: PC or smartphone?

What calendar would the Saturn nation use?

Convert Numbers To Emoji Math

Translation of "invincible independence"

Why is the episode called "The Last of the Starks"?

How can I test a shell script in a "safe environment" to avoid harm to my computer?

Can a player choose to add detail and flavor to their character's spells and abilities?

Are modes in jazz primarily a melody thing?

Can anyone identify this unknown 1988 PC card from The Palantir Corporation?

Is throwing dice a stochastic or a deterministic process?

If quadruped mammals evolve to become bipedal will their breast or nipple change position?

How is it believable that Euron could so easily pull off this ambush?

Why were the rules for Proliferate changed?

Select list elements based on other list

What did Varys actually mean?



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;








2















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






























    2















    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


























      2












      2








      2








      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 Apr 28 at 17:50







      alfredopacino

















      asked Apr 28 at 17:21









      alfredopacinoalfredopacino

      123116




      123116




















          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























          • 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
            Apr 28 at 17:44












          • what whereis mysql says?

            – Comar
            Apr 28 at 17:45











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

            – alfredopacino
            Apr 28 at 17:47











          • 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
            Apr 28 at 17:50












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

            – alfredopacino
            Apr 28 at 17:52


















          1














          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
            Apr 28 at 17:59












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

            – alfredopacino
            Apr 28 at 18:05











          • You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

            – Leo
            Apr 29 at 14:53


















          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|improve this answer























            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























            • 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
              Apr 28 at 17:44












            • what whereis mysql says?

              – Comar
              Apr 28 at 17:45











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

              – alfredopacino
              Apr 28 at 17:47











            • 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
              Apr 28 at 17:50












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

              – alfredopacino
              Apr 28 at 17:52















            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























            • 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
              Apr 28 at 17:44












            • what whereis mysql says?

              – Comar
              Apr 28 at 17:45











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

              – alfredopacino
              Apr 28 at 17:47











            • 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
              Apr 28 at 17:50












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

              – alfredopacino
              Apr 28 at 17:52













            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













            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












            share|improve this answer



            share|improve this answer










            answered Apr 28 at 17:40









            ComarComar

            27116




            27116












            • 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
              Apr 28 at 17:44












            • what whereis mysql says?

              – Comar
              Apr 28 at 17:45











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

              – alfredopacino
              Apr 28 at 17:47











            • 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
              Apr 28 at 17:50












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

              – alfredopacino
              Apr 28 at 17:52

















            • 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
              Apr 28 at 17:44












            • what whereis mysql says?

              – Comar
              Apr 28 at 17:45











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

              – alfredopacino
              Apr 28 at 17:47











            • 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
              Apr 28 at 17:50












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

              – alfredopacino
              Apr 28 at 17:52
















            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
            Apr 28 at 17:44






            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
            Apr 28 at 17:44














            what whereis mysql says?

            – Comar
            Apr 28 at 17:45





            what whereis mysql says?

            – Comar
            Apr 28 at 17:45













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

            – alfredopacino
            Apr 28 at 17:47





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

            – alfredopacino
            Apr 28 at 17:47













            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
            Apr 28 at 17:50






            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
            Apr 28 at 17:50














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

            – alfredopacino
            Apr 28 at 17:52





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

            – alfredopacino
            Apr 28 at 17:52













            1














            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
              Apr 28 at 17:59












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

              – alfredopacino
              Apr 28 at 18:05











            • You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

              – Leo
              Apr 29 at 14:53















            1














            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
              Apr 28 at 17:59












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

              – alfredopacino
              Apr 28 at 18:05











            • You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

              – Leo
              Apr 29 at 14:53













            1












            1








            1







            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 Apr 28 at 17:54









            LeoLeo

            1,515415




            1,515415












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

              – alfredopacino
              Apr 28 at 17:59












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

              – alfredopacino
              Apr 28 at 18:05











            • You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

              – Leo
              Apr 29 at 14:53

















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

              – alfredopacino
              Apr 28 at 17:59












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

              – alfredopacino
              Apr 28 at 18:05











            • You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

              – Leo
              Apr 29 at 14:53
















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

            – alfredopacino
            Apr 28 at 17:59






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

            – alfredopacino
            Apr 28 at 17:59














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

            – alfredopacino
            Apr 28 at 18:05





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

            – alfredopacino
            Apr 28 at 18:05













            You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

            – Leo
            Apr 29 at 14:53





            You might need to remove the binaries too, try this also: sudo rm -rf /usr/local/bin/mysql.

            – Leo
            Apr 29 at 14:53











            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|improve this answer



























              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|improve this answer

























                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|improve this answer













                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|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 28 at 18:40









                alfredopacinoalfredopacino

                123116




                123116



























                    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







                    Popular posts from this blog

                    Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                    Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                    What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company