Question

  • Creator
    Topic
  • #2162526

    MySQL password problem

    Locked

    by jiminpa ·

    Can you help me crack the root password? Ha! Kidding 😀

    Seriously though, I am having an issue with logging into MySQL form the command line as root. The problem is my password follows this pattern !password! this is a shop standard password. The problem is when I run the following command.

    #mysql -uroot -p!password!

    Linux returns “-bash: !password!: event not found

    Obviously the ! is being read as something other than a character in the password. If I just run the following.

    #mysql

    it doesn’t log me in as the root user it logs me in with a blank username. Is there any way I can pass the ! when I log in?

All Answers

  • Author
    Replies
    • #2452433

      Clarifications

      by jiminpa ·

      In reply to MySQL password problem

      Clarifications

    • #2452404

      is this…

      by m61 ·

      In reply to MySQL password problem

      …being run on windows or linux? i know linux [may] have issues with the ! character, so try placing a \ in front of each ! to escape it. not sure how this will work on windows.

      • #2452398

        It’s Linux

        by jiminpa ·

        In reply to is this…

        I’ll give it a try

      • #2570220

        and it didn’t work

        by jiminpa ·

        In reply to is this…

        starting to think I may have to reload from scratch.

        • #2570184

          try…

          by m61 ·

          In reply to and it didn’t work

          …this way:

          # mysql -uroot -p

          you will then be prompted for the password, but is this for a script? as this approach wont really work with a script

      • #3016985

        Escaping worked for me, or try this

        by maerf0x0 ·

        In reply to is this…

        Escaping any exclamation mark worked for me. I had forgot that ! had a meaning in bash. Alternatively you could change the password so that it doesnt include any exclamation marks (or other bash special characters)

    • #2570098

      Escape

      by choppit ·

      In reply to MySQL password problem

      mysql -uroot -p\!password\!

      but it’s safer to do it interactively

      mysql -uroot -p

Viewing 2 reply threads