百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>数据库> mysql用户函数区别详解
分享文章到:

mysql用户函数区别详解

发布时间:01/15 来源: 浏览: 关键词:
mysql提供了很多内部函数吗,其中查看用户的函数有四个,分别是:user()、system_user()、session_user()、current_user()。相信很多人见了他们都眼熟,或者已经用过他们。有木有感觉他们返回的值一直都是一样!?他们有没有区别,如果有是什么区别了?


只能说我菜,在网上找了下没发现谁解释过他们四个的区别,那就只能自己来了。下面是通过mysql客户端查看到的帮助信息,直接贴解释吧。

user:Returns the current MySQL username and hostname as a string in the utf8 character set.

system_user:SYSTEM_USER() is a synonym for USER().

session_user:SESSION_USER() is a synonym for USER().

current_user:

Returns the username and hostname combination for the MySQL account
that the server used to authenticate the current client. This account
determines your access privileges. As of MySQL 5.0.10, within a stored
routine that is defined with the SQL SECURITY DEFINER characteristic,
CURRENT_USER() returns the creator of the routine. The return value is
a string in the utf8 character set.

The value of CURRENT_USER() can differ from the value of USER().

其实想翻一下再放出来的,怎奈自己那见不人的英语水平,就不翻译了。总的来说:user()、system_user()、session_user(),这三是同一个东西(synonym )。然后current_user()跟前三个也很像,不过他偶尔又会有点区别。

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有4人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板