Terminal: MySQL password saved in directory but received an error that it doesn't exist?

In Terminal, I run the code: mysql_secure_installation, then it asks me for this:

Enter current password for root (enter for none):

It said earlier: The passwords for MySQL have been saved to: /root/.digitalocean_password

So I typed this in: cat /root/.digitalocean_password to retrieve that password.

But then I got this: cat: /root/.digitalocean_password: No such file or directory

I’m really lost. How do I get the MySQL password if I get the error of “No such file or directory?” All help is appreciated, thanks


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @confused5000

I’ve just tried to spin up a LAMP 16.04 (on NYC2), and it shows the password in that file. If you run this:

ls -la /root/

You should get a list of 4 files and 2 directories:


Otherwise you can reset the MySQL root password by following this tutorial: