问题描述
我的 MySQL 数据库需要两个用户:appuser 和 support.
其中一位应用程序开发人员坚持要求我为这些用户创建四个帐户:
My MySQL database needs two users: appuser and support.
One of the application developers insists that I create four accounts for these users:
appuser@'%'
appuser@'localhost'
support@'%'
support@'localhost'
就我的一生而言,我无法弄清楚他为什么认为我们需要这个.主机不会使用通配符来处理 'localhost' 吗?
For the life of me I can't figure out why he thinks we need this. Wouldn't using the wildcard as the host take care of the 'localhost'?
有什么想法吗?
(此处使用 MySQL 5.5)
(Using MySQL 5.5 here)
推荐答案
localhost 在 MySQL 中是特殊的,它意味着通过 UNIX 套接字(或 Windows 上的命名管道,我相信)上的连接,而不是到 TCP/IP 套接字.使用 % 作为主机不包含 localhost,因此需要明确指定.
localhost is special in MySQL, it means a connection over a UNIX socket (or named pipes on Windows, I believe) as opposed to a TCP/IP socket. Using % as the host does not include localhost, hence the need to explicitly specify it.
这篇关于创建 MySQL 用户时使用 % 作为主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)