How to Change MYSQL Root PASSWORD Ubuntu 14.04

January 3, 2015 19.9k views

I have created Droplet and Followed on of the Tutorial to infall LAMP.

However, Please can someone help me to Change the MYSQL Root Password (XXXXXX) as Shown in the MOTD below

Thank you for using DigitalOcean's LAMP Application.
Your web root is located at /var/www/html and can be seen from http://blah.blah.blah.blah/
The details of your PHP installation can be seen at http://1blah.blah.blah.blah/info.php
Your MySQL root user's password is XXXXXXX

You are encouraged to run mysqlsecureinstallation to ready your server for production.

I followed this Steps,

STEP [1]

Following STEP[1] , I am able to Login phpmyadmin using either of the NEW Password created in STEP[1]
Or using the MOTD's XXXXXXX

Is it Possible to Change this MOTD's password XXXXX to something else. I thought STEP [1] would help, but unfortunately it doesn't.

Thank you in advance.

1 comment
  • Use the mysqladmin command. From the man page:

    mysqladmin password "dontUseThisBogusPassword"
2 Answers

Here is what worked for me (just so you know I have installed phpmyadmin on top of mysql):

  1. type this into the terminal: mysqladmin -u root -p'oldpassword' password newpass
  2. find the motd.tail file located at /etc/motd.tail and edit it manually to reflect the new password

source 1
source 2

Have another answer? Share your knowledge.