PDA

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



lungkao
02-26-2009, 11:33 AM
Error connecting to MySQL: Access denied for user 'da_admin'@'localhost' (using password: NO)

Am Repair By guide: http://help.directadmin.com/item.php?id=45

but not work:confused:

nobaloney
02-27-2009, 09:42 AM
Because you're not using a password. The guide you referenced includes;

using password: YES
but your error states you're not using a password:

using password: NO
How are you attempting to connect?

Jeff

lungkao
02-28-2009, 07:39 AM
I don't know now:confused:

but i can login to phpmyadmin

or use command

mysql -uda_admin -p

Rich-Boy
03-13-2009, 07:35 AM
but i can login to phpmyadmin

or use command

mysql -uda_admin -p
Do you mean "cant" ?

If you know the correct info to login you need to ensure it's the same as what you see here; /usr/local/directadmin/conf/mysql.conf

If you don't know the login info you need to reset it and update the mysql.conf file

PRB
04-28-2009, 04:54 PM
im pulling my hair out...

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

on the MySQL management screen

Ive followed the tutorial many times (http://help.directadmin.com/item.php?id=45) and I can get into phpMyAdmin as da_admin perfectly. ive set the password to mysql.conf and still nothing...

I've done that tutorial like over 5-6 times and it isnt helping. can someone help me?

PRB
04-28-2009, 05:16 PM
I just rebooted the server, no help.

PRB
04-29-2009, 02:17 AM
No one knows the solution because its "using password: NO" ?

Michael.Terence
04-29-2009, 05:37 AM
cat /usr/local/directadmin/conf/mysql.conf

copy the password listed, and USE the password when attempting to connect to mysql.

armo
12-13-2009, 02:05 PM
Same problem .
password exists in .conf file and da_admin is set in system.
anybody ?

scsi
12-14-2009, 05:52 AM
Then just reset the mysql root password. There are guides on mysql.com how to do it.

daveyw
12-14-2009, 07:36 AM
No one knows the solution because its "using password: NO" ?SSH based;


mysql -u da_admin -pThen hit enter and write the MySQL pass listed in '/usr/local/directadmin/conf/mysql.conf'.

armo
12-15-2009, 04:26 AM
SSH based;

Then hit enter and write the MySQL pass listed in '/usr/local/directadmin/conf/mysql.conf'.


password exists in .conf file and da_admin is set in system with the same password.

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

scsi
12-15-2009, 06:44 AM
Then the script calling it is not set to use a password. Fix it.

armo
12-16-2009, 04:16 AM
anybody has any ideas ?

daveyw
12-16-2009, 04:37 AM
Where are you trying to connect to MySQL?
With a PHP script (or something else) or what?

It seems (many times told) that the script you are using isn't using any password or isn't set.

Check the config files or something where the MySQL settings are listed if you filled in any MySQL login information.

armo
12-16-2009, 01:16 PM
Where are you trying to connect to MySQL?
With a PHP script (or something else) or what?

It seems (many times told) that the script you are using isn't using any password or isn't set.

Check the config files or something where the MySQL settings are listed if you filled in any MySQL login information.

what is "/usr/local/directadmin/conf/mysql.conf" for ??

actually I'm talking about DirectAdmin as talked before.

scsi
12-16-2009, 01:21 PM
Its used for the database creation and deletion with the database manager in directadmin.

armo
12-16-2009, 01:53 PM
Its used for the database creation and deletion with the database manager in directadmin.

I think you can't understand what I say.
Let me explain well :

In my new server's DirectAdmin , in MySQL related sections , there is an error I said before :


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

(focus on "NO")

Password is set in /usr/local/directadmin/conf/mysql.conf


user=da_admin
passwd=MYPASSWORD

da_admin user is created and can login with the MYPASSWORD

What's the problem ?

daveyw
12-17-2009, 05:08 AM
Where exactly do you get the MySQL error message?
In directadmin self (domain.tld:2222) or with a script running on a directadmin box?

armo
12-18-2009, 11:16 PM
http://MY-IP-ADRESS:2222/CMD_DB?domain=SOME-DOMAIN

armo
12-19-2009, 01:04 AM
solved.
deleting and recreating the conf file solved that !
I thing white spaces or other unreadable characters causes the problem. not more ideas !

merlinsilk
02-05-2010, 09:30 PM
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

daveyw
02-06-2010, 08:53 AM
You could try this (http://help.directadmin.com/item.php?id=45) to fix the issue.

merlinsilk
02-06-2010, 01:11 PM
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

DirectAdmin Support
02-07-2010, 02:23 PM
Hello,

If you get:
(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:
locate my.cnfto see which my.cnf files you have on your system. You really should only have 2:
/etc/my.cnf
/usr/local/directadmin/conf/my.cnfJohn

merlinsilk
02-08-2010, 01:22 AM
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

scsi
02-09-2010, 06:50 AM
Thats very strange it needs a newline character in mysql.conf

I hope this can be added to help.directadmin.com

armo
09-07-2010, 02:04 AM
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

[client]
might be readable by DA ?

Jan_E
05-12-2011, 05:22 AM
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

scsi
05-12-2011, 07:11 AM
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].

Jan_E
05-12-2011, 07:39 AM
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

scsi
05-12-2011, 08:10 AM
Make sure that you dont have a /root/.my.cnf that preceeds with a period. It might be causing you the issues.

http://directadmin.com/forum/showthread.php?t=40083

Jan_E
05-12-2011, 08:29 AM
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.

scsi
05-12-2011, 08:47 AM
https://www.directadmin.com/clients/safesubmit.php

Fill out this form then and ask for assistance.

Jan_E
05-12-2011, 08:53 AM
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...