展会信息港展会大全

mysql用户函数区别 user()、system_user()、 session_user()
来源:互联网   发布日期:2016-01-27 15:50:04   浏览:2171次  

导读:只能说我菜,在网上找了下没发现谁解释过他们四个的区别,那就只能自己来了。下面是通过mysql客户端查看到的帮助信息,直接贴解释吧。 user:Returns the current MySQL username and hostname as a ...

只能说我菜,在网上找了下没发现谁解释过他们四个的区别,那就只能自己来了。下面是通过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()跟前三个也很像,不过他偶尔又会有点区别。

赞助本站

人工智能实验室

相关热词: 函数 user mysql

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港