mysqladmin: connect to server at 'localhost' failed

Locked
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

mysqladmin: connect to server at 'localhost' failed

Post by lmarcos »

I had to update MariaDB to 10.3 from 1.1x to get it correctly configured with Barracuda and utf8mb4 to get rid of an error in a Nextcloud installation (by the way, pretty nice post here about that even though I had to Google Translate it and I will try to post it in the English forum).

During the install, I forgot to enter the password for root and had to switch plugin for root because it was getting 'Plugin 'unix_socket' is not loaded'

After I solved that and set a new password, I'm now getting the following error:
Cron <root@servername> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
/etc/cron.daily/logrotate:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
Any ideas on how to solve it? I'm running Ubuntu 18.04.

Thanks in advance.
User avatar
Tobi
Community Moderator
Posts: 2812
Joined: Thu 5. Jan 2017, 13:24

Re: mysqladmin: connect to server at 'localhost' failed

Post by Tobi »

Have a look at viewtopic.php?f=2&t=9024#p21110

This should solve your problem.
Gruß,
Tobi


-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: mysqladmin: connect to server at 'localhost' failed

Post by lmarcos »

Ok. I guess you also got the message below and recommend going back to setting unix_socket as plugin and setting it.
/etc/cron.daily/logrotate:
mysqladmin: connect to server at 'localhost' failed
error: 'Plugin 'unix_socket' is not loaded'
error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
I guess it either calls for a translation and a new thread in English or a link from the Nextcloud installation one I created today :lol:
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: mysqladmin: connect to server at 'localhost' failed

Post by lmarcos »

I managed to lock myself out of the database again following those instructions (might use German to English translation nexttime instead of German to Spanish)... So next I tried to upgrade to mariadb 10.4 and I'm getting a lot of errors.
Trying to access the KH panel Database error: SQLSTATE[HY000] [1698] Access denied for user 'keyhelp_root'@'localhost'

Webmail (rainloop) and db-management (adminer) load but can't go pass authentication. Adminer is saying session timed out or something like that (Sesión caducada).

I changed my three database users to connect via mysql_native_password and those are working after resetting the passwords to the previous ones.

MariaDB [mysql]> select Host,User,password,plugin from mysql.user;
+-----------+------------------+----------+-----------------------+
| Host | User | Password | plugin |
+-----------+------------------+----------+-----------------------+
| localhost | root | | unix_socket |
| localhost | mysqladmin | | unix_socket |
| localhost | keyhelp | | unix_socket |
| localhost | keyhelp_root | | unix_socket |
| localhost | phpmyadmin | | unix_socket |
| localhost | roundcube | | unix_socket |
| localhost | rainloop | | unix_socket |
| localhost | XXX | XXX | mysql_native_password |
| localhost | YYY | XXX | mysql_native_password |
| localhost | ZZZ | XXX | mysql_native_password |
| localhost | debian-sys-maint | | mysql_native_password |
+-----------+------------------+----------+-----------------------+

What do I do about the rest of passwords? Is there any way to restore them? The most urgent for me are the rainloop & keyhelp ones because I'm now left without email and it's not even returning any error message to senders.

PS I was connecting to KH with another user name. If that is an alias, I can try using that password with mysql_native_password lugin if someone can tell me wich of the two KH users was that.

PS2, I've set mysqladmin to mysql_native_password and the password in the keyhelp_login_data file, but I don't see any improvement.
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: mysqladmin: connect to server at 'localhost' failed

Post by lmarcos »

I was finally able to find the backup and could recover the hashed passwords, so I'm back and running once again. :D
Locked