What are mySQL credentials?

Hi There, I inherited a 1Click LAMP install on a droplet that was created 3 years ago. I need to move the db off the droplet for a number of reasons but I don’t know the credentials to login to mySQL or the db username and passwords.

I can access via SSH fine. I have FTP access and can view the site config files which do have the DB name and user/pass (according to wordpress) but that doesn’t seem to be working to dump.

When I log in and run

mysql -u root -p

and using passwords like ‘root’, ’ ’ & my ssh password I’m being declined.

How do I find this out? I’ve found numerous posts on this issue in Digital Ocean including those which tell me my password in included in the MOTD when I log in. Here’s my welcome screen after loggin in via SSH

root@XXX.XX.XX.XXX's password: 
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-150-generic x86_64)

 * Documentation:
 * Management:
 * Support:

  Get cloud support with Ubuntu Advantage Cloud Guest:

251 packages can be updated.
10 updates are security updates.

New release '18.04.4 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

You have new mail.

You can see password is empty. I have tried an empty password logging into mySQL without success. What can I do to access to the DB/mySQL ?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Accepted Answer


Usually with the 1-Click installs, the passwords are saved to a file when the droplet is created. Try having a look for any .password files in the root directory. I’ve just created a new droplet and the passwords are at ‘root/.digitalocean_password’ so that may be worth a try.

Hope this helps, Mike

Site Moderator
Site Moderator badge
June 6, 2020

Hello, @ScoutDigital

As per @mchlbwyr reply you need to check the file in order to obtain the MySQL credentials. You can also double check the information provided in the one-click LAMP page as well:

The MySQL root password is in /root/.digitalocean_password

Regards, Alex

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.