Mysql>INSERT INTO Mysql.user (Host,user,password) VALUES ("localhost" ," Test ", Password (" 1234 "));added a user name of test, password for 1234 users, but the user can only log on locally, if you want to remotely log in, you can change localhost to% to indicate that any computer can log on, or to a specific IP address can only be landed on a specific IP.
- Add permissions for a user
mysql>grant all privileges in testdb.* to [e-mail protected] identified by ' 1234 ';represents the addition of any operation to all tables of the TestDB database to user test when logging on locally. If you want to specify permissions, you can modify all privileges to select or update or delete or the combination of the three, if you want to specify the permissions of the table, you can testdb.* Modifying to Testdb.info means that the info table in the TestDB database can be manipulated; If you want to specify the address of the access, you can change the @% to localhost to indicate that the user test can only perform local operations on the database.
- Refresh System Permissions Table
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";
MySQL Add, remove users, add permissions