Mysql user management

Source: Internet
Author: User
1. View users
Use mysql;
Select * from user;
2. Add and authorize a user:
(1) Add users that can log on to any machine
Grant all privileges on dbName. * TO test @ "%" identified by "1111 ";
(2) Add a user logging on to the server 172.16.184.233
Grant all on dbName. * TO test@172.16.184.233 IDENTIFIEDBY "1111 ";
(3) Add a user to grant addition, deletion, modification, and query permissions.
Grant select, INSERT, DELETE, update on dbName. * TO test @ % IDENTIFIEDBY "1111 ";
However, this
Grant all privileges on *. * to 'test' @ 'localhost' identified by '123'
3. revoke permissions
Revoke all privileges on *. * from 'test' @ 'localhost'
4. delete a user
Use mysql;
Delete from user WHERE User = "test" and Host = "localhost ";
5. Change User Password
Use mysql;
Update mysql. user set password = password ('new password') where User = "test" and Host = "localhost ";

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.