Database login:
Mysql-h ip-p Port-U account –p
Enter, and then type the password
To create a user:
MySQL>insert into MySQL. User (Host,uservalues(' localhost ', ' username ', password (' password '));
Refresh System Permissions Table
MySQL>privileges;
For user rights
MySQL>Grantall on database name. * to JEECN@localhost by ' JEECN '; MySQL>Privileges ;
If you want to specify partial permissions to a user, you can write:
MySQL>GrantSelect,update on jeecndb. * to JEECN@localhost by ' JEECN '; -- refreshes the System permissions table. mysql>privileges;
Permission Description:
MySQL>Grant on to username @ user address 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.
Delete User
MySQL>DELETEfromuserWHEREuser= ' and Host= 'localhost '; MySQL>privileges;
Modify User Password
MySQL>update MySQL. User set Password=whereUser= ' and Host= 'localhost ' ; MySQL>privileges;
Mysql Operation user