Supplied password for mysql in one-click-lamp instance doesn't work

I’ve just setup a new one-click-lamp instance and am having trouble accessing MySQL. I’ve always used phpmyadmin to manage my databases so I installed that following the guides here. Once installed I tried to login using ‘root’ and the password supplied in the /root/.digitalocean_password file. This didn’t work right from the start.

I’ve since tried many methods on various help threads to try and reset the root password and I still can’t login. The only user I can login to phpmyadmin with is ‘phpmyadmin’ and the password is in /etc/phpmyadmin/config-db.php. This user has zero permissions though and can’t do anything.

The other weird thing(I think) is that if I run the ‘MySQL -u root -p’ in my CLI, I can use any old password or none at all and I can run MySQL commands there all I like. Is this normal?

I’m not sure what’s going on or if somehow in my various attempts to reset the root password I’ve screwed it all up. It never worked from the start though and I can’t seem to figure it out.

Any help would be appreciated. I may have to try a whole new droplet to see if this is normal.



Hey. Thanks for the follow up. Last night I spun up a new plain Ubuntu 18.04 instance and installed Apache, MySQL and PHP from scratch. Again I ran into the same issue where I couldn’t access MySQL using the root user and a password. Only this morning when I ran through this specific guide did I realise that the root user is set to only connect via ‘auth_socket’ instead of ‘mysql_native_password’. I’m not sure if this is a recent default on newer versions of MySQL or what but when you don’t realise that this is set, everything else can be really hard to figure out. It’s especially hard because when you connect via ssh to your instance for the first time, the message explicitly tells you that your root password is stored at ‘/root/.digitalocean_password’. So naturally you’d assume this would work. Kinda tricky. I may have missed something somewhere that explains this but yeah, not sure if it could be clearer.


Hey friend! I’m waiting to talk to our the master of one-click images on this side to understand a couple of things, but I am looking at this with intent to follow up. Just wanted to let you know it isn’t being ignored.

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.

Accepted Answer

Came here just to thank gvanroyen (not the MOD, who appears to have never publicly followed up), to say THANK YOU for that tip about auth_socket. I realized too that I can do “sudo mysql -u root” but of course the supplied instructions about finding the root password in /root are misleading. Seems an update to the one-click instructions is in order…

For people searching for quick answer.

  1. Connect to your droplet
  2. copy & run command: sudo mysql -u root
  3. copy & run command: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpasswordhere';

After this you wont be able to connect to MySQL without password in shell.

One click instructions on MySQL, LEMP, LAMP and other where effected, should definitely be updated…

Is there a solution for this? It still does not work nearly a year later on the LEMP stack (not LAMP but probably the same issue.)

Same happens to me with LEMP 1-click app.