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