ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    MySQL MariaDB password reset without knowing the password

    IT Discussion
    centos mysql mariadb
    9
    29
    2.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • IRJI
      IRJ
      last edited by

      Yeah it is really simple if you have root access. Use any of the results on the first page of "How to reset mysql password"

      https://duckduckgo.com/?q=reset+mysql+admin+password&t=canonical&ia=web

      1 Reply Last reply Reply Quote 1
      • DustinB3403D
        DustinB3403
        last edited by

        Will give those a go and report back once I have a positive result.

        Thanks!

        1 Reply Last reply Reply Quote 0
        • IRJI
          IRJ
          last edited by

          In fact you dont even have to reset, you can just assume root access as root user without a password in most cases.

          1 Reply Last reply Reply Quote 1
          • dafyreD
            dafyre
            last edited by

            Short, short version.

            update mysql.user set password=password('dumbpassword') where user='dumbuser';
            
            1 Reply Last reply Reply Quote 0
            • dbeatoD
              dbeato
              last edited by

              You could use

              sudo mysql -u root
              
              1 Reply Last reply Reply Quote 3
              • Alex JonesA
                Alex Jones
                last edited by

                Did you get it reset?

                1 Reply Last reply Reply Quote -2
                • DustinB3403D
                  DustinB3403
                  last edited by

                  I was able to change the password, but it doesn't appear to allow the program to that uses this database to work.

                  What am I missing?

                  1 Reply Last reply Reply Quote 0
                  • DustinB3403D
                    DustinB3403
                    last edited by

                    So I've been able to reset the root mysql user password, which is great, so now that's secured and functional. Now I just need to change the database user password and update the config file for said new password.

                    But to figure out how the password is hashed. . .

                    dbeatoD dafyreD 2 Replies Last reply Reply Quote 0
                    • dbeatoD
                      dbeato @DustinB3403
                      last edited by

                      @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                      So I've been able to reset the root mysql user password, which is great, so now that's secured and functional. Now I just need to change the database user password and update the config file for said new password.

                      But to figure out how the password is hashed. . .

                      why, just change it on the system, do you need to enter the hashed password because there is no other way to change the application Database configurations?

                      DustinB3403D 1 Reply Last reply Reply Quote 0
                      • DustinB3403D
                        DustinB3403 @dbeato
                        last edited by

                        @dbeato the system was setup as a demo and was moved to production. The person who set up the environment is no longer and I'm just trying to close any holes that may exist.

                        The system isn't super critical, but it would be nice to have all of this aligned.

                        dbeatoD 1 Reply Last reply Reply Quote 0
                        • dbeatoD
                          dbeato @DustinB3403
                          last edited by

                          @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                          @dbeato the system was setup as a demo and was moved to production. The person who set up the environment is no longer and I'm just trying to close any holes that may exist.

                          The system isn't super critical, but it would be nice to have all of this aligned.

                          is this the demo you mentioned a while ago on a rant?

                          DustinB3403D 1 Reply Last reply Reply Quote 0
                          • DustinB3403D
                            DustinB3403 @dbeato
                            last edited by

                            @dbeato said in MySQL MariaDB password reset without knowing the password:

                            @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                            @dbeato the system was setup as a demo and was moved to production. The person who set up the environment is no longer and I'm just trying to close any holes that may exist.

                            The system isn't super critical, but it would be nice to have all of this aligned.

                            is this the demo you mentioned a while ago on a rant?

                            Not recalling which rant in particular, you'd have to remind me. But I don't think so.

                            dbeatoD 1 Reply Last reply Reply Quote 0
                            • dbeatoD
                              dbeato @DustinB3403
                              last edited by

                              @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                              @dbeato said in MySQL MariaDB password reset without knowing the password:

                              @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                              @dbeato the system was setup as a demo and was moved to production. The person who set up the environment is no longer and I'm just trying to close any holes that may exist.

                              The system isn't super critical, but it would be nice to have all of this aligned.

                              is this the demo you mentioned a while ago on a rant?

                              Not recalling which rant in particular, you'd have to remind me. But I don't think so.

                              This one
                              https://mangolassi.it/topic/1022/what-are-you-doing-right-now/69963

                              DustinB3403D 1 Reply Last reply Reply Quote 0
                              • DustinB3403D
                                DustinB3403 @dbeato
                                last edited by

                                @dbeato said in MySQL MariaDB password reset without knowing the password:

                                Not recalling which rant in particular, you'd have to remind me. But I don't think so.

                                That's from months ago, not nearly recent, and that was an ESXi/Dell issue I was ranting about.

                                1 Reply Last reply Reply Quote 0
                                • dafyreD
                                  dafyre @DustinB3403
                                  last edited by

                                  @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                                  So I've been able to reset the root mysql user password, which is great, so now that's secured and functional. Now I just need to change the database user password and update the config file for said new password.

                                  But to figure out how the password is hashed. . .

                                  That should be easy as above... Change the DB user's password, and then update the config file in the application to use the right password.

                                  Did that not work?

                                  DustinB3403D 1 Reply Last reply Reply Quote 0
                                  • DustinB3403D
                                    DustinB3403 @dafyre
                                    last edited by

                                    @dafyre said in MySQL MariaDB password reset without knowing the password:

                                    @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                                    So I've been able to reset the root mysql user password, which is great, so now that's secured and functional. Now I just need to change the database user password and update the config file for said new password.

                                    But to figure out how the password is hashed. . .

                                    That should be easy as above... Change the DB user's password, and then update the config file in the application to use the right password.

                                    Did that not work?

                                    It didn't because the config file has the password hashed, so I'm looking into how that is hashed from the dev so I can update it there.

                                    I think this topic is closed just need to figure out the program side config file.

                                    1 Reply Last reply Reply Quote 0
                                    • DustinB3403D
                                      DustinB3403
                                      last edited by

                                      Which, the password is hashed in mysql, so it's not in plain text, and from that it gets hashed and put into the config file that the program uses.

                                      1 Reply Last reply Reply Quote 0
                                      • DustinB3403D
                                        DustinB3403
                                        last edited by DustinB3403

                                        Okay so the password is actually in plain text in the config file. . . so now that I know that I can update the password and go from there.

                                        And here I thought it was hashed. . .

                                        JaredBuschJ 1 Reply Last reply Reply Quote 0
                                        • DustinB3403D
                                          DustinB3403
                                          last edited by

                                          Which also means, now that I know what the password is, I don't need to change it. . .

                                          1 Reply Last reply Reply Quote 0
                                          • JaredBuschJ
                                            JaredBusch @DustinB3403
                                            last edited by JaredBusch

                                            @DustinB3403 said in MySQL MariaDB password reset without knowing the password:

                                            Okay so the password is actually in plain text in the config file. . . so now that I know that I can update the password and go from there.

                                            And here I thought it was hashed. . .

                                            This is normal usage for applications. There is no point in storing a password any other way.

                                            If you need to log in to a system, you send the username and password. Nothing ever sends a hashed password to login. Just WTF led to even thinking that?

                                            So because of that why store it in any weird form? It will have to be reversed into the raw password anyway to log in.

                                            3220e00f-7bab-4244-a898-c917300e2f73-image.png

                                            DustinB3403D 1 Reply Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post