MySQL Forums
Forum List  »  Quality Assurance

connect to server through localhost and
Posted by: guo xiang
Date: April 02, 2008 02:50AM

suppose I create two account on mysql server : bob@localhost and bob@ 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@ with password bob127 login
(3)If I start mysqld normal( that is without --skip-name-resovle)I delete bob@localhost and add it again ,I can alsouse bob@ 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 | ...
| | bob | … ...
| | root | … ...

If use it to explain the case 1 and 2 . how to explain the case 3 with it ?
Thank U!

Options: ReplyQuote

Written By
connect to server through localhost and
April 02, 2008 02:50AM

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.