MySQL User function difference

Source: Internet
Author: User
Tags character set mysql client

Can only say that I food, found on the internet did not find who explained their four differences, it can only own. The following is a MySQL client to see the help information, directly posted to explain it.

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's 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's 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 ().

Actually want to turn over to put out again, zennai oneself that see no person's English level, do not translate. Overall: User (), system_user (), Session_user (), these three are the same thing (synonym). Then Current_User () is similar to the front three, but occasionally he will be a little different.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.