Show all users, MySQL basic operation

Source: Internet
Author: User

Can be implemented to display all users in the database. Select User from Mysql.user;select User,host,password from Mysql.user;to create a user for a table, authorize:

The Create user command:

<!---->mysql> CREATE USER yy identified by '123';

YY indicates the user name you want to create, and the following 123 indicates the password

The user created above can log in anywhere.

If you want to restrict landing at a fixed address, such as localhost login:

<!---->mysql> CREATE USER [email protected] identified by '123';

Grant

<!---->mysql> GRANT all privileges on *. * to user; @localhost

<!---->Grant Select,insert,update,delete on * * to [e-mail protected] "%" identified by "ABC";

Grant Select,insert,update,delete on * * to [e-mail protected] "%" identified by "ABC";

Format: Grant Select on database. * To User name @ login host identified by "password"

Change Password:

<!---->mysql> Grant all privileges the pureftpd.* to [e-mail protected] identified by ' Mimi ';

Flush

<!---->mysql> Flushprivileges;

To view user information:

<!---->mysql> Select Host,user from Mysql.user;

Show all users, MySQL basic operation

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.