Why do I have different usernames from mysql.user and select user()?
What you should run is this

Please run this query:

SELECT USER(),CURRENT_USER();


What do these functions return ???


USER() reports how you attempted to authenticate in mysqld
CURRENT_USER() reports how you were allowed to authenticate by mysqld


Please note that CURRENT_USER() should return something from mysql.user. You said that USER() returns user_Name@localhost@localhost. If CURRENT_USER() comes back with the same response as USER(), then MariaDB has a bug.

Since USER() reports how you attempted to authenticate in mysqld, my guess would be that's probably how you typed it.

mysql -u user_Name@localhost


You should login to MariaDB like this

mysql -u user_Name -hlocalhost


Try it again and see. I discussed this before in this forum : MySQL error: Access denied for user &#39;a&#39;@&#39;localhost&#39; (using password: YES)