mysql提供了很多內(nèi)部函數(shù)嗎,其中查看用戶的函數(shù)有四個(gè),分別是:user()、system_user()、session_user()、current_user(),相信很多人見(jiàn)了他們都眼熟,或者已經(jīng)用過(guò)他們,有木有感覺(jué)他們返回的值一直都是一樣,他們有沒(méi)有區(qū)別,如果有是什么區(qū)別了?
只能說(shuō)我菜,在網(wǎng)上找了下沒(méi)發(fā)現(xiàn)誰(shuí)解釋過(guò)他們四個(gè)的區(qū)別,那就只能自己來(lái)了,下面是通過(guò)mysql客戶端查看到的幫助信息,直接貼解釋吧.
user:Returns the current MySQL username and hostname as a string in the utf8 character set.//Vevb.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().
其實(shí)想翻一下再放出來(lái)的,怎奈自己那見(jiàn)不人的英語(yǔ)水平,就不翻譯了,總的來(lái)說(shuō),user()、system_user()、session_user(),這三是同一個(gè)東西(synonym ),然后current_user()跟前三個(gè)也很像,不過(guò)他偶爾又會(huì)有點(diǎn)區(qū)別.
新聞熱點(diǎn)
疑難解答
圖片精選