Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Error connecting to MySQL: Access denied for user: ‘da_admin@localhost’  (Read 7735 times)

0 Members and 1 Guest are viewing this topic.

jominj

  • Guest
When connecting to the MySQL screens in DirectAdmin, if this error appears, that would indicated that the “da_admin” user has not been setup correctly. To resolve this do the following.
  • Make sure the root mysql password works. The mysql root password can be found in the /usr/local/directadmin/scripts/setup.txt if it has not been deleted. It’s under the header “mysql=”. If it cannot be found, then mysqld will have to be restarted with the –skip-grant-tables option:

Code: [Select]
service mysqld stop
mysqld_safe –skip-grant-tables &

That should start up mysql without the need for a root password. Once in, type

Code: [Select]
use mysql
UPDATE user SET password=PASSWORD(‘newpass’) WHERE user=’root’;
FLUSH PRIVILEGES;
quit
That will reset the root password for you.

Type “killall -9 mysqld_safe; killall -9 mysqld” to shut down mysqld.

Start it up again with

Code: [Select]
/sbin/service mysqld start
  • Once the root mysql password is set and known, then you can begin the process of resetting the da_admin mysql user. Type:

Code: [Select]
mysql -uroot -pThen press enter. You’ll be asked for the password. Once in mysql, type:

Code: [Select]
GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost IDENTIFIED BY ‘newdapass’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

That should set the password for da_admin in mysql.

  • Now we need to make sure it’s setup correctly for DA to use. Edit /usr/local/directadmin/conf/mysql.conf and set

user=da_admin
passwd=newdapass

  • Test it out in DirectAdmin.