Skip to content

What is the MySQL root password in DirectAdmin?

You can find the MySQL root password in two locations on DirectAdmin installations. You can find it at /usr/local/directadmin/conf/mysql.conf and the format will be as follows:

host=
passwd=mysqlpassword
port=0
socket=/var/lib/mysql/mysql.sock
user=da_admin

You can also find it in your DirectAdmin setup file located at /usr/local/directadmin/conf/setup.txt. The format will be as follows:

adminname=admin
adminpass=adminpassword
email=admin@server-host.da.direct
hostname=server-hostname.da.direct
ip=server-ip
mysql=mysqlpassword
ns1=ns1.server-hostname.da.direct
ns2=ns2.server-hostname.da.direct

In both cases the MySQL username is da_admin.

You can access MySQL using the da_admin user and the password found in the configuration files above. For example:

Terminal window
mysql -u da_admin -p

You will be prompted to enter the password.

Alternatively, you can store the password in a MySQL configuration file ~/.my.cnf to avoid being prompted. You should add the following to the file:

[client]
user=da_admin
password=mysqlpassword

After creating this file, you can connect to MySQL without being prompted by just running mysql.