Error connecting to MySQL: Access denied for user 'da_admin'@'localhost'

solved.
deleting and recreating the conf file solved that !
I thing white spaces or other unreadable characters causes the problem. not more ideas !
 
Somehow the problem described here was never solved - unfortunately I ran into the same problem and so I hope that a year and a half later somebody might be able to help.

The problem is that everything is apparently set up correctly
da_admin has password abcdefg
and that password is also set correctly in
/usr/local/directadmin/conf/mysql.conf

but DA apparently does not send the password because the error message says

Error connecting to MySQL: Access denied for user 'da_admin'@'localhost' (using password: NO)

and not as in the repair guide

Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES)

- the difference here being NO v. YES

All this had been working correctly for me until my viretual server had been moved to different hardware. I can only assume that some setting had been missed and that is biting me now - but I can't find anything where that might be set - to use a password v. not using a password.

Any kind soul that can help?

Thanks
Merlin
 
Last edited:
Yeah, tried that - it's in the first or one of the first posts in this thread. But, as I said and the other desperate user above as well, the password for da_admin are correct and are entered in the DA config file - it's DA which does not use the password that I give it.

To demonstrate on the command line:

here I use the command line parameter -p

# mysql -uda_admin -p
Enter password: (here I entered the wrong password)
ERROR 1045 (28000): Access denied for user 'da_admin'@'localhost' (using password: YES)

and I get "using password: YES"

then in my next try I leave out the -p

# mysql -uda_admin
ERROR 1045 (28000): Access denied for user 'da_admin'@'localhost' (using password: NO)

and now I get "using password: NO"

If DA would be written in php I probably could find where that command is issued but that is not an option - so I might actually need somebody from DA to help out - - - hello!

Merlin
 
Hello,

If you get:
Code:
(using password: NO)
it means one of two things:

1) There is a missing newline character in the:
/usr/local/directadmin/conf/mysql.conf
Edit that file and press return after the last line to add a blank space at the bottom. In all DA config files, each line needs to end in a newline character or DA wont see it. (eg: press enter)

2) There is a my.cnf or .my.cnf somewhere overriding ours. The most common suspect is /root/.my.cnf. If you have that file, remove it.. or remove the user/pass option from it. As of a few DA versions ago, we changed DA's call to mysqldump to use the --defaults-extra-file, pointing to the /usr/local/directadmin/conf/my.cnf. This was to prevent the user/password from being used on the command line. However, if you have the /root/.my.cnf, or the user/pass set in any my.cnf file aside from the /usr/local/directadmin/conf/my.cnf file, you might run into that error. Run:
Code:
locate my.cnf
to see which my.cnf files you have on your system. You really should only have 2:
Code:
/etc/my.cnf
/usr/local/directadmin/conf/my.cnf
John
 
Hi John,

thank you so much!
It was the missing newline character after the password in the config file.

Things are looking good now :)

Merlin
 
Thats very strange it needs a newline character in mysql.conf

I hope this can be added to help.directadmin.com
 
Missing newline is a common problem but I meet the my.cnf problem as of upgrading to mysql 5.1

Have my.cnf in /usr/local/directadmin higher priority than mysql.conf ?
The line
Code:
[client]
might be readable by DA ?
 
Same problem

I have got the same problem at
http://www.example.com:2222/CMD_DB?domain=example.com

root and da_admin passwords are correct (I checked at the shell and in phpMyAdmin).

My config:

[root@colo610 ~]# locate my.cnf
/etc/my.cnf
/usr/local/directadmin/conf/my.cnf
[root@colo610 ~]# cat /etc/my.cnf
[mysqld]
local-infile=0
[root@colo610 ~]# cat /usr/local/directadmin/conf/my.cnf
[client]
user=da_admin
password=xxxxxxxx

[root@colo610 ~]# ls -la /usr/local/directadmin/conf/my.cnf
-rw-r--r-- 1 root root 42 May 12 14:03 /usr/local/directadmin/conf/my.cnf
[root@colo610 ~]# ls -la /etc/my.cnf
-rw-r--r-- 1 root root 24 Jun 2 2010 /etc/my.cnf

The newline is there (actually a double one at the moment), I deleted and recreated the file, I tried chown diradmin:diradmin, rebooted the server several times etc. Directadmin still says:

Error connecting to MySQL: Access denied for user 'da_admin'@'localhost' (using password: NO)
Repair guide: http://help.directadmin.com/item.php?id=45

The repair guide does not help, because da_admin requires a password and Directadmin sends none.

Any ideas?

Jan
 
The file should be /usr/local/directadmin/conf/mysql.conf not my.conf or my.cnf

And it should only have 2 lines in it the one for username and the one for password. No [client].
 
No luck

Thanks for the speedy reply.

There already was a mysql.conf in /usr/local/directadmin/conf, even without the [client]. I chmodded that one to 644, renamed the my.cnf, rebooted the server and still get the "(using password: NO)" error message.

Locate mysql.conf only returned this file, so that cannot be the problem either. Any other ideas?

Jan
 
No dice

No .my.cnf (or .mysql.conf) anywhere. Not in /root, not in /. Locate cound not find either of them. I now tried to copy the config of two other (running) servers. No /etc/my.cnf and in /usr/local/directadmin/conf a mysql.conf without the [direct] and a my.cnf with the [direct]. Both chowned diradmin:diradmin. Both with the newline. chmod 400 mysql.conf, chmod 600 my.cnf

Did not work. I am out-of-ideas.
 
Solved!

Stupid thing.

MySql uses in my.cnf password=xxxxx (if any)
Directadmin looks for passwd=xxxxx in mysql.conf

Quite illogical behaviour of Directadmin. Documented for those that are looking for a solution as well...
 
Back
Top