• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Access denied for user 'admin'@'localhost' - Urgent

duvide

Basic Pleskian
I needed to set up a DB in command line for OpenEMM. I always then got the error
Access denied for user 'admin'@'localhost' (using password: YES)
I was looking to solve this and followed the usual instruction but I always got this message.
And right now I can't even log onto the Plesk panel anymore (the container still works though).
In the panel I get this message now
ERROR: Zend_Db_Adapter_Exception: SQLSTATE[HY000] [1045] Access denied for user 'admin'@'localhost' (using password: YES) (Abstract.php:144)
I followed the instruction but is is always
Access denied for user 'admin'@'localhost' (using password: YES)
I also checked this post http://talk.plesk.com/threads/error...ccess-denied-for-user-admin-localhost.321390/
and the link from there to do this
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` mysql
When I look in
/var/log/mysqld.log
there is also no error message.
What to do? I am locked out to maintain my server.:(

Thank you!
 
Thank you for your reply but whatever I do I get the same error and I am still not able to to use the Plesk panel:
[root@v146xx ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow`
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
-------------------
[root@v146xx ~]# cat /etc/psa/.psa.shadow
$AES-128-CBC$lsoD9UtJL397FmMaDJq67w==$XzJ4AubRdfygLHskGeCa2g==
Try to connect to the MySQL database and update the admin password:
[root@v146xx ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
-------------------
[root@v146xx ~]# mysql skip-grant-tables
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
--------------------
[root@v146xx ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` mysql
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
 
Where?
What's result of this

Note: If you are unable to connect, enable skip-grant-tables in the /etc/my.cnf file, restart MySQL, then update the admin password:

[mysqld]
skip-grant-tables

# /etc/init.d/mysqld restart
# mysql -uadmin
mysql> UPDATE mysql.user SET Password=PASSWORD('$AES-128-CBC......') WHERE User='admin';

Note: do not forget to remove skip-grant-tables after that.

?
 
So, you have added line skip-grant-tables in [mysqld] section of /etc/my.cnf file, restarted mysql server with # /etc/init.d/mysqld restart and still can't login with # mysql -uadmin with the same error message? Right?
 
So, you have added line skip-grant-tables in [mysqld] section of /etc/my.cnf file, restarted mysql server with # /etc/init.d/mysqld restart and still can't login with # mysql -uadmin with the same error message? Right?
You are the god Igor! And I am stupid, I admit it. I misread that I had to make the change in the my.cnf file, I thought it was a mysql command.

Thanks a lot, I am back on!
 
One more thing. All this started because I wanted to create a database for openEMM but I still get this error
[root@v146xx ~]# mysqladmin -uadmin -p create openemm_cms
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'admin'@'localhost' (using password: YES)'
Why can't I create a database in root (or admin)?
 
You need to use

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` create openemm_cms

instead of

# mysqladmin -uadmin -p create openemm_cms
 
Gentlemen,

Please help with the following issue if possible:
Environment: CentOS 7, Plesk 12.5.30 (update 18), MariaDB up to date.

Plesk web interface communicate with MySQL normally,
mysql -u admin -p`cat /etc/psa/.psa.shadow`
- works normally
,
but when I run /usr/local/psa/admin/bin/autoinstaller - it pulls after the update confirmation:
Trying to establish test connection... ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
[a lot of repeats further...]

from what I found on workaround on connection issues,
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin mysql
also pulls:
ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
- not sure about this connection type, maybe it is somehow incompaitble with new mysql versions and hardcoded somewhere in installer scripts?
Tried to reset plesk admin passwords as described in kb.plesk.com tickets with no luck, compared .psa.shadow, its mysql password function with what stored for admin@localhost - everything seems ok.
Is there some workaround for this issue?

In parallel - I've just successfully used plesk web components updater, but still interesting on if there is workaround for command line autoinstaller.
 
Uh-oh, finally found that. Thanks much Igor!
I've read KB article on this and checked yesterday, but seems like overlooked that.
 
I tried all things but still i can not do that. Please help me.

2ivcgu0.png

i can not add skip-grant-tables overthere. How can i do that?
 
i can not add skip-grant-tables overthere. How can i do that?
You need to edit the file /etc/my.cnf instead of displaying it. Please try an editor like "vi", e.g.
# vi /etc/my.cnf
Move cursor to a line in the [mysqld] section, then press
ESC
then press
o
to create a new empty line. Then enter
skip-grant-tables
into that line. Then press
ESC
then write
:qw
to save the changes to the file and exit the editor.

Continue with restarting the database server, updating the password, removing the "skip-grant-tables" from /etc/my.cnf again (enter dd to delete the line in vi), restart database server again and you should be set.
 
Back
Top