Question

MySQL root password

  • Posted February 25, 2013

Hi,

I just created a new droplet and used the “LAMP on Ubuntu 12.04” application to set it all up and have LAMP installed automatically. Works great, but when I want to install phpmyadmin, it asks for the MySQL password. I tried several options like “root” or empty, but it doesn’t work. Where can I find the password for MySQL? Thanks!

Subscribe
Share

If you login to your droplet under root from the command line/terminal. It should say in the welcome message what your MySQL password is…

/root/.digitalocean_password really works, thanks!

You can test access directly by doing: mysql -u root to see if the root user has no password set, if it doesn’t work then it means one is set.

The first step of that tutorial doesn’t work:

/etc/init.d/mysql stop

reports “OK” but doesn’t actually stop the mysqld process.

stop mysql

did the trick, from here

the rest of the instructions worked fine :)

This comment has been deleted

@williamb: Take a look at this tutorial (Recover MySQL root Password) for instructions on how to reset your MySQL root password.

ola tudo bem a todos eu não estou conseguindo mudar minha senha do mysql alguem pode me da uma ajuda?


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.

When you install a LAMP droplet in digitalOcean this is the code to get your mysql password cat /root/.digitalocean_password

Log in and like this answer so that it can get to the top

If you installed LAMP ubuntu or whatever flavour of Linux that just cat the motd message to find the password (why put it here i wonder???) <br>root@domain:/var/www# cat /etc/motd.tail <br>------------------------------------------------------------------------------------- <br>Thank you for using DigitalOcean’s LAMP Application. <br>Your web root is located at /var/www/html and can be seen from http://xxx.xxx.xxx.xxx/ <br>The details of your PHP installation can be seen at http://xxx.xxx.xxx.xxx/info.php <br>Your MySQL root user’s password is XXXXXXXXXX <br>You are encouraged to run mysql_secure_installation to ready your server for production. <br>------------------------------------------------------------------------------------- <br>To delete this message of the day: rm -rf /etc/motd.tail

STOP all and read >> If you installed LAMP ubuntu or whatever flavour of Linux that just cat the motd message to find the password (why put it here i wonder???) root@domain:/var/www# cat /etc/motd.tail

When you install MySQL often it will ask you to set a root password which you may have set and forgotten. <br> <br>You can test access directly by doing: <br># mysql -u root <br> <br>To see if the root user has no password set, if it doesn’t work then it means one is set. <br> <br>You can restart mysql with skip grant privileges which will remove any auth and then login and reset the password though it may be just easier to reinstall MySQL if you haven’t setup any databases yet.

@rekcahx: Log in to your droplet and read the MOTD. The MySQL password is there.

To get the Default MySQL password for pre-installed LAMP (Ubuntu 14 image)

On root console execute following command reload SSH

This comment has been deleted

@kamaln7 and @payetteforward 's answer is right for me. Thanks so much.

If you’re using a Wordpress image and logged in as root, you can find the MySQL root password with this command:

cat ~/.my.cnf