Use the following command to create a mysql account with various permissions ):
1. create a user and have the permissions to create a database, modify fields, delete tables, add, delete, modify, and query tables, and to allow remote and even remote login (equivalent to the root account ):
Grant select, insert, update, delete, create, drop, alter on *. * to reson1 @ "%" identified by "123456 ";
Grant select, insert, update, delete, create, drop, alter on *. * to reson1 @ localhost identified
"123456"; (you must add a "%" and a localhost to support both local access and remote access from any ip address. Reson1 indicates the user name and 123456 indicates the password)
2. Create a user and have the permission to add, delete, modify, and query tables. You can only log on locally:
Grant select, insert, update, delete on *. * to reson2 @ localhost identified by "123456 ";
3. Create a user and have the permission to add, delete, modify, and query tables. You can only log on to 192.168.1.100 and only operate on dat1 databases:
Grant select, insert, update, delete on dat1. * to reson3@192.168.1.100 identified by "123456 ";
Master the above three cases to create mysql accounts with various permissions.