MySQL Create user and SSC website build

Source: Internet
Author: User
Tags mysql create mysql create user

There are three ways MySQL creates users: the SSC Web site, the INSERT user table method, the Create user method, and the Grant method. Enterprise: 217 1793 408
1. Create user by creating users command
Script: CREATE USER ' username ' @ ' host ' [Identified by ' PASSWORD '] where the password is optional;
Example: CREATE USER ' test ' @ ' 127.0.0.1 ' identified by "123";
CREATE USER ' Test ' @ ' 127.0.0.% ' identified by "123";
CREATE USER ' Test ' @ '% ';
Note: This method is created by the user only to connect to the database permissions, need to follow-up authorization;
2. Create a user with the grant command
Personal habits generally use this method to create a user, grant will authorize the user when the database exists, but when the database does not exist, the user will create
and authorized by the appropriate user. (indicates that the above step is superfluous)
Script:
GRANT <all|priv1,priv2,..... privn> on [object] [identified by ' Password ']
[with GRANT OPTION];
Max_queries_per_hour Count
Max_updates_per_hour Count
Max_connections_per_hour Count
Max_user_connections Count
Description: Priv represents permission Select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process, File, etc. 14 permissions
Example: Mysql>grant select,insert,update,delete,create,drop on test.hr to [e-mail protected] identified by ' 123 ';
Description: Assigns the user test of the host to 127.0.0.1 the ability to perform operations such as Select,insert,update,delete,create,drop on the HR table of the database test, and to set the password
To 123.
Mysql>grant all privileges on test. to [e-mail protected] identified by ' 123 ';
Description: Assigns the user test of the host 127.0.0.1 to all operations on the database test all tables, and sets the password to 123.
Mysql>grant all Privileges
on
. To [e- Mail protected] identified by ' 123 ';
Description: Assigns the user test to the host 127.0.0.1 the right to perform all operations on all tables in all databases and sets the password to 123.
Mysql>grant all Privileges
on
. * to [e-mail protected] identified by ' 123 ';
Description: User test assigns permissions to all operations on all tables in all databases and sets the password to 123.

MySQL Create user and SSC website build

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.