Differences between mysql user functions

Source: Internet
Author: User

I can only talk about my food. I found it on the Internet and didn't find anyone explaining the four differences between them, so I had to do it myself. The following is the help information you can view on the mysql client.

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

In fact, if I want to try again, I will not translate it if I can't see anyone's English skills. In general, user (), system_user (), and session_user () are the same thing (synonym ). Then current_user () is similar to the first three, but occasionally it 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.