Where the user manages user data:
All users in MySQL are stored in the user table in the system database (MySQL)--regardless of which database users are stored here.
The initial contents of the table are as follows:
To create a user:
Form:
Create user ' username ' @ ' Allow login address/server ' identified by ' password ';
Description
1, allow the login address/server is, allow the location of the setting, to use the user name and password to login, other locations do not;
2, visible, MySQL security authentication, requires 3 information.
Example:
To view the user table in MySQL:
To delete a user:
Drop user ' username ' @ ' Allow login address or server name ';
To modify a user password:
To modify your password:
Set Password = password (' password ');
Modify someone else's password (provided that you have permission):
set password for ' username ' @ ' Allow login address ' = password (' password ');
What are Rights Management permissions?
MySQL database, all of the things that can be done, divided into more than 30 permissions, each of which is a "word"! Like what:
Select: The representative can query the data;
Update: The representative can modify the data;
Delete: representative can delete data;
.......
Where there is a permission called "all": means all permissions;
Have the following permissions:
Another form of presentation (with Chinese description):
To grant permissions:
Form:
Grant permission list on a library. An object to ' username ' @ ' Allow login location ' "Identified by ' password ';
Description
1, the permission list, that is, multiple permissions of the nouns, with each other separated by commas, such as: SELECT, INSERT, update
You can also write: all
2, a library. An object that is assigned to a "subordinate unit" in a specified database;
Subordinate units are: Table name, view name, stored procedure name, storage function name;
Of these, there are 2 special grammars:
*. *: Represents all sub-units in all databases;
A library. *: Represents all sub-units in the specified library;
3, "identified by ' password '" is to omit the part, if not omitted, it means the right to empower the same time, also to modify its password;
However: if the user does not store it, it is actually creating a new user, and the password must be set at this time.
Deprivation of authority:
Form:
Revoke permission list on a library. An object from ' User name ' @ ' Allow login location '
The meaning is exactly the same as in Grant;
MySQL---Data Control language (users and their rights management)