Search Our Database

How to change ‘da_admin’ user password in MySQL (DirectAdmin)

Last updated on |
by

Introduction

This guide is intended to managing DirectAdmin servers who need to change the da_admin password for MySQL. It covers the process for updating the da_admin password to ensure security and access control. This is necessary when you suspect unauthorized access or when rotating credentials for security compliance. The steps are applicable on DirectAdmin servers via SSH and should be done carefully to avoid service disruptions.

 

Prerequisites

  • SSH access to the DirectAdmin Server
  • MySQL credentials

 

Steps by steps guide

 

1. Login to the Server via SSH

ssh [username]@[your_server_ip]

 

2. Log in to MySQL

Start by logging into MySQL using the da_admin account. Enter the following command in the shell prompt:

mysql -u da_admin -p

You will be prompted to enter the current password. Type the password and press Enter.

 

3. Select the MySQL Database

Once logged in, switch to the MySQL database by typing the following command at the mysql> prompt:

mysql> use mysql;

 

4. Update the Password

To change the password for da_admin, enter the following command:

*Replace NEW_PASSWORD with the new password

mysql> ALTER USER 'da_admin'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';

 

5. Reload Privileges and Exit

To apply the changes, reload the privileges and exit MySQL with the following commands:

mysql> flush privileges; 
mysql> quit;

 

6. Update DirectAdmin Configuration

Finally, update the DirectAdmin configuration to use the new password. Edit the /usr/local/directadmin/conf/mysql.conf file with vim, nano, or your preferred text editor:

vi /usr/local/directadmin/conf/mysql.conf

Locate the line with the old password, replace it with the new password ‘NEW_PASSWORD’, and save the file.

 

Conclusion

Changing the da_admin password in MySQL is a straightforward process that involves logging into MySQL, updating the password, and then configuring DirectAdmin with the new credentials. By following these steps, you ensure that your MySQL user credentials are secure and up-to-date. Always remember to back up any important data before making changes to avoid potential issues.

 

Article posted on 23 February 2020 by Louis