Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I created a new db in WAMP, and I note that under the 'Privileges' tab that list the users I have one user that I didn't create, named 'root'. What is it? It is listed twice, once under 'localhost' and once under '127.0.0.1'. I understand that this is the address for 'localhost', but why list it twice? Also, I created a user, 'admin', and it appears under 'localhost', but not 127.0.0.1'. I'd like to understand why.

share|improve this question

put on hold as off-topic by Falcon Momot, Jenny D, MadHatter, EEAA, MichelZ Sep 29 at 5:53

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – EEAA, MichelZ
  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Falcon Momot, Jenny D, MadHatter
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 3 down vote accepted

In MySQL, the root user is a system default. What the users are "appearing under" is the host specification for the user; this allows controlling of the devices that a user is able to log in from. Oftentimes this can be restricted to a single device (as in your case, since the web server is on the same system), but in other cases remote access is needed from different location/network or a number of locations; this would require different host specifications.

The system default root account is specified with localhost and 127.0.0.1 as a failsafe for when the skip-name-resolve option is used in the configuration; in that case, the localhost specification is useless and root would be unable to log in without the 127.0.0.1 entry.

share|improve this answer
    
+1 Very good and simple explaination. I've always wondered why there was a localhost and 127.0.0.1 entry... :) –  Kyle Smith May 19 '11 at 0:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.