Mysql> grant Permissions 1, permissions 2,... Permission n on the database name. Table name to User name @ user address identified by ' connection password ';
Permissions 1, Permissions 2,... Permission n represents 14 permissions, such as Select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file.
When permissions 1, permissions 2,... Permission n is replaced by all privileges or all to give the user full permission.
When the database name. The table name is replaced by *. *, which indicates that the user is given permission to manipulate all tables on the server.
The user address can be localhost, or it can be an IP address, a machine name, and a domain name. You can also use '% ' to indicate connections from any address.
' Connection password ' cannot be empty, otherwise the creation failed.
For example
mysql>grant Select , Insert,update,delete,create,drop on Vtdc.employee to [email protected] identified by ' 123′; The
assigns the user Joe from 10.163.225.87 the ability to perform operations such as Select,insert,update,delete,create,drop on the employee table VTDC the database, and sets the password to 123.
MYSQL> grant all privileges on vtdc.* To [email protected] identified by ' 123′; The
assigns user Joe from 10.163.225.87 the right to all operations on the database VTDC all tables, and sets the password to 123.
MYSQL> grant all privileges on * * to [ Email protected] identified by ' 123′; The
gives user Joe from 10.163.225.87 the right to all operations on all tables in all databases and sets the password to 123.
MYSQL> grant all privileges on * * to [ Email protected] identified by ' 123′; The
gives the native user Joe permission to perform all operations on all tables in all databases, and sets the password to 123.
GRANT all on * * to [e-mail protected] ' 110.86.28.214 ' identified by ' root ' with GRANT OPTION;
Give 110.86.28.214 all permissions on all databases, root account ' root ' password;
Add permissions for remote link mysql