Mysql adds and deletes users, adds permissions, and mysql Permissions
Mysql> insert into mysql. user (Host, User, Password) values ("localhost", "test", password ("1234"); adds a user name named test and Password of 1234, however, this user can only log on locally. If you want to log on remotely, you can change localhost to % to indicate that any computer can log on, or change to a specific ip address to indicate that you can only log on to a specific ip address.
Mysql> grant all privileges on testDB. * to test @ localhost identified by '000000'; indicates that the user test has added any operations on all tables of the testDB database during local login. If you want to specify permissions, you can change all privileges to select, update, or delete or a combination of the three. If you want to specify table permissions, you can set testDB. * Changing to testDB.info indicates that operations can be performed on the info table in the testDb database. to specify the access address, you can change @ % to localhost, indicating that user test can only perform database operations locally.
- Refresh system permission list
Mysql> flush privileges;
Mysql> Delete FROM user Where User = 'test' and Host = 'localhost ';
- Delete accounts and permissions
Mysql> drop user username @ '% ';
Mysql> update mysql. user set password = password ('new password') where User = "test" and Host = "localhost ";