[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: identity confusion



Wayne Sallee wrote:

> This is interesting. I'm not sure what to think about this.
> 
> on terminal, as user1
> su -
> # Enter root password.

so now you are root

> su - user2
> # No password is needed.

so now you are user2

> mysql
> Access denied for user 'user1'@'localhost' (using password: NO)
> 

obviously in the local cnf files is set something else. Note mysql user1 has
probably nothing to do with system user1

check here
~/.my.cnf       User-specific options
~/.mylogin.cnf  User-specific login path options (clients only)

https://dev.mysql.com/doc/refman/8.0/en/option-files.html

> 
> # Now if I enter:
> mysql -u user2 -pmypassword
> # It will let me in.
> 
> 
> What surprises me, is that it figures that user1 is wanting access to
> mysql instead of user2 Knowing a previous user, could have security
> issues.
> 

Look in the environment setup - usually it is more simple than one would
think.

regards



Reply to: