suppose I create two account on mysql server : bob@localhost and
bob@127.0.0.1 with differrent password boblocal and bob127
then I connect to server with:
$mysql -ubob -pboblocal -S /tmp/mysql.sock ,that's correctly.
*But* ,when I use:
(1)$mysql -ubob -pbob127 -h127.0.0.1
ERROR 1045 (28000): Access denied for user 'bob'@'localhost' (using password: YES)
If I change password to boblocal,I can login and it display currentuser:bob@localhost
and via unix socket.
(2)If I start mysqld with --skip-name-resolve,I can use
bob@127.0.0.1 with password bob127 login
*OR*
(3)If I start mysqld normal( that is without --skip-name-resovle)I delete bob@localhost and add it again ,I can alsouse
bob@127.0.0.1 with password bob127 login
I search the Mysql Manual,I find mysqld start with load the authorities list and sort it as follows:
+-----------+----------+-
| Host | User | …
+-----------+----------+-
| localhost | bob | … ...
| localhost | |root | ...
| 127.0.0.1 | bob | … ...
| 127.0.0.1 | root | … ...
+-----------+----------+-
If use it to explain the case 1 and 2 . how to explain the case 3 with it ?
Thank U!