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

Quoting MySQL docs:

If you cannot figure out why you get Access denied, remove from the user table all entries that have Host values containing wildcards (entries that contain '%' or '_' characters). A very common error is to insert a new entry with Host='%' and User='some_user', thinking that this enables you to specify localhost to connect from the same machine. The reason that this does not work is that the default privileges include an entry with Host='localhost' and User=''. Because that entry has a Host value 'localhost' that is more specific than '%', it is used in preference to the new entry when connecting from localhost! The correct procedure is to insert a second entry with Host='localhost' and User='some_user', or to delete the entry with Host='localhost' and User=''.

What I can't understand is why is this entry there in the first place? I fail to come up with any purpose they could serve.

Could I have potentially broken something by deleting them? (One of the suggested actions in the quote above)

Note: I know there are multiple questions asking why user@'%' won't work and answers containing this exact quote. What I want to know is why is this problem(?) created in the first place.

share|improve this question

closed as not constructive by Magellan, RobM, Jay, Michael Hampton, Ward Nov 2 '12 at 0:34

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

It is an anonymous account and can be used for various purposes where you don't want to have to specify a username and password, such as within a script.

Granted this is a security hole but is also limited to being on the localhost. You could also alter the grant privileges of this anonymous account so that it can only do selects on a particular database or even single table.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a>                   with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.1.30.2262\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </noscr"], "copyright__copyright__copyright": ["\n\nIt is an anonymous account and can be used for various purposes where you don't want to have to specify a username and password, such as within a script.\n\nGranted this is a security hole but is also limited to being on the localhost. You could also alter the grant privileges of this anonymous account so that it can only do selects on a particular database or even single table.\n\nshare|improve this answer\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}