建站软件 优化软件 编程软件 网页辅助 站群程序 网站程序 图像处理 资源教程 字体下载 推荐软件


您的位置:首页 > MYSQL学习 > mysql用户函数有哪些

mysql用户函数有哪些

时间:2015-05-06 10:32:25  来源:免费模板网 作者:风雪 阅读次数 tagsmysql技巧

mysql提供了很多内部函数,其中查看用户的函数有四个,分别是:user()、system_user()、session_user()、current_user(),感觉他们返回的值一直都是一样,他们有没有区别,如果有是什么区别了?

User() 这个函数, 是取得  当前登陆的用户.

相当于问 MySQL  我是谁 的意思。

mysql> SELECT USER();
+----------------+
| USER()         |
+----------------+
| root@localhost |
+----------------+ 

1 row in set (0.00 sec)

通过mysql客户端查看到的帮助信息,直接贴解释吧.

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

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()跟前三个也很像,不过他偶尔又会有点区别.

本文地址:https://www.freemoban.com/mysql/2015/0506/1755.html

猜你喜欢
栏目推荐
模板推荐

Copyright:www.freemoban.com 免费模板网 All Rights Reserved 网站备案:辽ICP备19014872号-2   辽公网安备 21010602000376号  辽公网安备:42900402000182号

免责声明:本站部分资源来自互联网收集,版权归原创者所有,如果侵犯了你的权益,我们会及时删除侵权内容,联系QQ:1615187561 谢谢合作!