About MySQL creating a new user and authorizing

Source: Internet
Author: User

    • To create the user's syntax:

Create user ' username ' @host [identified by [password] ' password '];

    1. Username: User Name
    2. Host: hostname, local host can use localhost or IP address, but other computers must use IP address to log on to remote host with wildcard "%"
    3. Password: User Password

Cases:

Create user ' teacher ' @ ' localhost ' identified by ' 12345 ', or

Create user ' teacher ' @ ' localhost (no password)

    • Execute Grant ( while assigning permissions) Create user

Grammar:

Grant Priv_type on database or data table to [email protected] (or IP address) identified by ' 123 ';

    • using MySQL Admin Modify Root account Password
    • Grammar:

Mysqladmin–u root–p password "123";

Enter Password: original password (root);

    • using Set Chitian Modify the normal user password (MySQL 's command)

Grammar:

Set Password=password ("000"); Modify the current user password

Set password for [email Protected]=password ("123"); Modify the specified account password

    • Delete a normal user

Drop user ' studentr ' @localhost;

About MySQL creating a new user and authorizing

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.