Access denied for user 'user'@'localhost' (using password: YES)

Hello A today I am getting error messages like this :

Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

same with any another user on server, also when I trying to install Joomla with script installer I am getting this error message: Failed to run database setup script : ERROR 1115 (42000) at line 14: Unknown character set: 'utf8mb4

Old websites are working fine & have no errors yet, I have already checked support, forums for answer, but I can not "figure it out"

rpm -qa | grep mysql mysql-server-5.1.73-5.el6_7.1.x86_64 mysql-libs-5.1.73-5.el6_7.1.x86_64 mysql-devel-5.1.73-5.el6_7.1.x86_64 php-mysql-5.3.3-46.el6_7.1.x86_64 php55-php-mysqlnd-5.5.21-4.el6.x86_64 mysql-5.1.73-5.el6_7.1.x86_64 php54-php-mysqlnd-5.4.16-22.el6.centos.alt.x86_64

mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

use mysql sh: use: command not found

Little help please Thanks in Advance

Status: 
Active

Comments

Howdy -- was there perhaps a .my.cnf file added into root's homedir in /root?

That would override every other MySQL call, and could cause the symptoms you're seeing.

If I go to Webmin -> Servers -> MySQL, -> to " Change Administration Password". New Password: Failed to change administration password : DBI connect failed : Access denied for user 'root'@'localhost' (using password: YES)

No, have only one my.cnf in /etc/ /etc/my.cnf

Just to verify, are you looking for a file beginning with a "."?

That would only show up when doing a directory listing such as this:

ls -la /root

Yes Little bit mess in it, but no my.cnf in root's homedir

ls -la /root dr-xr-x---. 34 root root 4096 May 19 16:39 . dr-xr-xr-x. 27 root root 4096 May 9 22:42 .. -rw-------. 1 root root 25934 May 19 16:39 .ICEauthority drwxr-xr-x. 3 root root 4096 Nov 3 2015 .abrt -rw-------. 1 root root 20078 Apr 19 19:24 .bash_history -rw-r--r--. 1 root root 18 May 20 2009 .bash_logout -rw-r--r--. 1 root root 176 May 20 2009 .bash_profile -rw-r--r--. 1 root root 176 Sep 23 2004 .bashrc drwx------. 4 root root 4096 Jan 12 17:51 .cache drwx------. 6 root root 4096 Oct 13 2015 .config drwxr-xr-x. 6 root root 4096 Oct 13 2015 .cpan -rw-r--r--. 1 root root 100 Sep 23 2004 .cshrc drwx------. 3 root root 4096 Oct 13 2015 .dbus -rw-------. 1 root root 16 Oct 13 2015 .esd_auth drwx------. 5 root root 4096 May 19 16:39 .gconf drwx------. 2 root root 4096 May 19 17:03 .gconfd drwx------. 9 root root 4096 Jan 11 22:17 .gnome2 drwx------. 2 root root 4096 Oct 13 2015 .gnome2_private drwxr-xr-x. 3 root root 4096 Oct 13 2015 .gnote drwx------. 2 root root 4096 May 19 16:39 .gnupg drwxr-xr-x. 2 root root 4096 Oct 13 2015 .gstreamer-0.10 -rw-r--r-- 1 root root 107 May 19 16:39 .gtk-bookmarks dr-x------ 2 root root 0 May 19 16:39 .gvfs -rw-r--r-- 1 root root 623 May 19 16:39 .imsettings.log drwxr-xr-x. 3 root root 4096 Oct 13 2015 .local drwxr-xr-x. 4 root root 4096 Oct 13 2015 .mozilla -rw-------. 1 root root 189 Oct 15 2015 .mysql_history drwxr-xr-x. 2 root root 4096 Oct 13 2015 .nautilus drwxr-----. 3 root root 4096 Oct 13 2015 .pki drwx------. 2 root root 4096 Oct 13 2015 .pulse -rw-------. 1 root root 256 Oct 13 2015 .pulse-cookie drwx------. 2 root root 4096 Oct 13 2015 .pyzor drwxr-xr-x. 2 root root 4096 Oct 14 2015 .razor -rw-------. 1 root root 1024 Oct 13 2015 .rnd drwx------. 2 root root 4096 Oct 13 2015 .spamassassin drwx------. 2 root root 4096 Oct 13 2015 .ssh -rw-r--r--. 1 root root 129 Dec 3 2004 .tcshrc drwx------. 4 root root 4096 Dec 29 01:05 .thumbnails -rw------- 1 root root 58 Apr 11 19:48 .xauth2Pyr51 -rw------- 1 root root 58 Feb 26 08:37 .xauth4Cl9Be -rw------- 1 root root 58 Feb 23 09:36 .xauthBcUTFl -rw------- 1 root root 58 Jan 29 10:04 .xauthFWd3kp -rw------- 1 root root 58 Jan 16 21:35 .xauthFaQo0e -rw------- 1 root root 58 Dec 29 22:06 .xauthHLG7ek -rw------- 1 root root 58 Jan 13 13:18 .xauthJxMRbd -rw------- 1 root root 58 Jan 29 10:04 .xauthLmU8nN -rw------- 1 root root 58 May 19 15:12 .xauthiFmpH2 -rw------- 1 root root 58 Jan 17 18:47 .xauthna1na7 -rw------- 1 root root 58 Feb 1 09:30 .xauthpZbm7o -rw------- 1 root root 1962 May 19 17:11 .xsession-errors -rw------- 1 root root 6637 Apr 19 19:24 .xsession-errors.old

It's very odd that you typed " mysql -u root -p" on the command line, but that it thinks you aren't using a password.

That suggests that what you're trying to do is being overridden somewhere.

Are you aware of any changes that were made recently?

However, just to rule out the passwords being out of sync, you may want to go into Webmin -> Servers -> MySQL -> Module Config, and there, set the "Administration login" and "Administration password" fields to the correct root password.

After doing that, does it stop throwing the Access Denied error in Virtualmin? (note that this is different from the "Unknown character set: 'utf8mb4" problem).

I am using Virtualmin Pro When I change the password from Webmin -> Servers -> MySQL -> i have only "Change Administration Password" Password is set as root password, like mysql was installed, when I change the password for new i receive the error: Failed to change administration password : DBI connect failed : Access denied for user 'root'@'localhost' (using password: YES) After that, if I back to Servers -> MySQL I have to set password for root again, because it's come up empty.

Are you aware of anything on your server that may have been changed recently, especially changes related to MySQL?

When I tipe mysql -u root -p from command line "direct in the server" ( i have full access) can connect to mysql, When I go through Webmin -> Others -> Command Shell ->

mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Ah, that makes more sense.

Yeah it won't be possible to use the mysql utility through the Webmin command shell, as the mysql utility is interactive.

That's good that it works from the command line though, that means MySQL is working properly.

I just realized the issue with something you shared above though -- when going into Webmin -> Servers -> MySQL, there should be a Module Config option on the top. In the new Authentic theme, it may just show up as a gear-shaped settings icon.

That is where you would need to go in order to change the password that Virtualmin tries to use for MySQL.

After change the password for Virtualmin use MySQL Installing script to new website i have: Access denied for user 'user'@'localhost' (using password: YES)

Installing Joomla from script installer :: Failed to run database setup script : ERROR 1115 (42000) at line 14: Unknown character set: 'utf8mb4' .

But Locally by command line for every user -> mysql -u root -p -> mysql -u user1 -p -> mysql -u user2 -p .... working fine What I have missed here I can't understand ?????

Edit: I'm changing my exact answer from what I had previously typed out.

The Joomla install problem, where you're getting "Unknown character set: 'utf8mb4'" -- that's an unrelated problem. We can address that, once the authentication issues are fixed.

As to why you're getting access denied in Virtualmin --

Were the database passwords perhaps changed outside of Virtualmin?

That would explain some things.

The same way that you updated root's MySQL password, you may need to update the other user passwords as well.

You can do that by going into Edit Databases -> Passwords, and setting the correct password there.

I have checked all users for mysql login permissions, all is ok, but I have only one with mysql permission problem. Even if change password for this user, user can't login or have no permissions in MySQL, I have no idea, why )))

Just to clarify, are you saying you updated the password for that user as described above? And even after updating the password, you're continuing to see an authentication error?

Yes, even when updated password for this user i'm continuing to see an authentication error. I will try to delete domain, user & will try to do again from "beginning", maybe i will "figure it out"

well yes, checked by command line newly added domain & user, now user have no authentication errors in MySQL.

OK, thank you for help this issue can be closed Thank you & have great weekend (tomorrow) ;)