MySQL Forums
Forum List  »  Newbie

Not understanding the simplest security scenario
Posted by: Jon D
Date: July 23, 2022 04:26PM

Hi,

I'm going crazy trying to understand why this command works (on my local test infrastructure):

----------- TEST START -----------

root:/etc/mysql# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.29-0ubuntu0.22.04.2 (Ubuntu)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select user, host, plugin from mysql.user;
+------------------+-----------+-----------------------+
| user | host | plugin |
+------------------+-----------+-----------------------+
| debian-sys-maint | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | auth_socket |
+------------------+-----------+-----------------------+
5 rows in set (0.00 sec)

----------- TEST END -----------

and this command fails:

----------- TEST START -----------

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

----------- TEST END -----------

I've read many of the docs, but cannot find an explanation for this. Could anyone please help?

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Not understanding the simplest security scenario
July 23, 2022 04:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.