1

I need to find a SQL users password, I can't reset it.

All I know is that there is a MySQL History file containing this information on Ubuntu 12.04

1
  • This will be tough, and nearly impossible depending on the strength of the password, since the password is stored securely.
    – Ramhound
    Commented Jan 30, 2016 at 19:43

2 Answers 2

2

There isn't a record, and passwords are hard to decrypt. If you entered a password on the command-line, that might be retrievable (but you probably would have found that, using grep).

Further reading:

0

If the password was entered while starting MySQL from a shell prompt, you may, as an alternative place to check, be able to find it in the Bash history file for the user's acount, which is .bash_history in the user's home directory. E.g., if the user entered the command below:

$ mysql --user=users_acct --password=users_password

If you viewed the contents of the Bash history file for that user's account you would see the command with the password just as you would see other commands entered from the user's account. E.g., if the user's account was jdoe:

# grep mysql ~jdoe/.bash_history
mysql --user=users_account --password=users_password

But, if the user entered the command mysql -u users_acct -p and didn't follow the -p or --password with the password, but instead just entered one of those parameters without putting the password immediately after it then the system will prompt for the password and it won't be in the Bash history file.

Not the answer you're looking for? Browse other questions tagged .