Using % for host when creating a MySQL user

前端 未结 6 1584
醉酒成梦
醉酒成梦 2020-11-29 18:06

My MySQL database needs two users: appuser and support.
One of the application developers insists that I create four accounts for these users:

appuser@\'         


        
6条回答
  •  醉酒成梦
    2020-11-29 18:42

    Going to provide a slightly different answer to those provided so far.

    If you have a row for an anonymous user from localhost in your users table ''@'localhost' then this will be treated as more specific than your user with wildcard'd host 'user'@'%'. This is why it is necessary to also provide 'user'@'localhost'.

    You can see this explained in more detail at the bottom of this page.

提交回复
热议问题