MySQL root password recovery in DirectAdmin

DirectAdmin MySQL root password is set within the installation process and written down to setup.txt. If you didn't change this password you can find the default one in the setup.txt, use the command below to see the contents of this file:

less /usr/local/directadmin/scripts/setup.txt

your password is stored in the line starting with mysql=

If you want to access mysql from ssh or console directly create a file in /root/ dir called .my.cnf:


touch /root/.my.cnf


and edit this file with the vi editor:

vi /root/.my.cnf

Add the lines below:


Fill the password with the pass you got from setup.txt, save the file with SHIFT+ZZ or :wq and exit. After this step just write mysql to enter MySQL console directly without password.

[root@test ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 169833
Server version: 5.0.77-log MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



VeriTeknik I.T. Solutions Ltd., is a DataCenter company in Turkey.
VeriTeknik Telecom Ltd., is an Internet Service Provider in Turkey.

VeriTeknik I.T. Sloutions Ltd., VeriTeknik Telecom Ltd. 2004 - 2010
Eskişehir Yolu 17.km. Çamlık Park Sitesi 2365. sk. No:7 Bağlıca Ankara Turkey +90.312 234 20 00