01. Licensing Issues

Source: Internet
Author: User

0. If MySQL does not initialize the password, first initialize the password
mysql–u rootmysql>update user set Password=password ('123456') where user=  'root';

1. Set all IPs by changing the table to log in
MySQL-u root–pmysql> use mysql;mysql'% ' Root'; MySQL>Select Host, user from user;

You can log on to any host using the root account and Root's original password

2. You can log in by authorizing all IPs
' Root '@'%'123456' with GRANT Option;flush privileges;

Authorized user root connect to MySQL server from any host using password 123456

3. You can log in by authorizing the specified IP
' Root '@'218.12.50.60'Mark' with GRANT Option;flush privileges;

Authorized user root uses the password mark to connect to the MySQL server from a host with the specified IP 218.12.50.60:

4. Permission Restrictions

Authorization expression:

The data object is *. *: Authorizing all databases and tables in the MySQL server

Data object is dbname.*: Authorization for all tables under single database dbname in MySQL server

The data object is Dbname.user: authorizing the user table under a single database dbname in the MySQL server

Unbind an expression

The definition of the data object is the same as above

MySQL permission expression

permissions granted to ordinary users for all table crud on the database TestDB: GrantSelectOn testdb.*'General_user'@'%'Grant Insert on TestDB. * To'General_user'@'%'Grant Update on TestDB. * To'General_user'@'%'GrantDeleteOn testdb.* to'General_user'@'%'GrantSelect(Id,name,birth) on testdb.*'General_user'@'%'can be used directly: GrantSelect, INSERT, UPDATE,DeleteOn testdb.* to'General_user'@'%'Authorized Database Developer permissions: Grant Create on TestDB. * to [email protected]'192.168.0.%'; Grant ALTER on TestDB. * to [email protected]'192.168.0.%'; Grant drop on TestDB. * to [email protected]'192.168.0.%'; Grant references on TestDB. * to [email protected]'192.168.0.%'; Grant create temporary tables on TestDB. * to [email protected]'192.168.0.%'; GrantIndexOn testdb.* to [email protected]'192.168.0.%'; Grant CREATE view on TestDB. * to [email protected]'192.168.0.%'; Grant Show view on TestDB. * to [email protected]'192.168.0.%'; Grant create routine on TestDB. * to [email protected]'192.168.0.%'; Grant alter routine on TestDB. * to [email protected]'192.168.0.%'; Grant Execute on TestDB. * to [email protected]'192.168.0.%'; Grant all privileges in TestDB to [email protected]'localhost'    

01. Licensing Issues

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.