Change the root and da_admin mysql users password

  • Login to mysql server, type the following command  at shell prompt:
# mysql -uroot -p$(grep mysql= /usr/local/directadmin/scripts/setup.txt | cut -d'=' -f2)

Firstly, we need to generate two random passwords one for user root and second for user da_admin.
Use this website to generate two random passwords. Passwords should be 14 characters lenght.

  • Use mysql database (type command at mysql> prompt):
mysql> use mysql;

 

  • Change password for user root, enter:
mysql> update user set password=PASSWORD("PASSWORD1") where User='root';

Where PASSWORD1 is the first password generated from lastpass.com.

  • Change password for user da_admin, enter:
 mysql> update user set password=PASSWORD("PASSWORD2") where User='da_admin';

Where PASSWORD2 is the first password generated from lastpass.com.

  • Finally, reload the privilegies with:
mysql> flush privileges;
mysql> quit;

 

  • After that, we need to tell directadmin what are the new passwords. Edit with vim/nano or your favorite editor the file:
nano /usr/local/directadmin/conf/mysql.conf


Edit the passwd line and delete the old password and copy the PASSWORD2 in place.

You might also need the modify the file /usr/local/directadmin/conf/my.cnf if the file exists in the same way mysql.conf was modified.

  • 387 Users Found This Useful
Was this answer helpful?

Related Articles

How to install DirectAdmin

Manual installation of DirectAdmin Here's the official DirectAdmin installation guide:...