1. navicat
1) First, the root user New Connection
2) new user mysql
3) Click permission, choose to add permissions, MySQL appear in existing database list, select the user you want to open for the new database, select here "maibao" database, select the necessary permissions information (I'm here for a full access select) to determine
4) Check the new user rights to the database, as in FIG.
5) It is important that, do not forget to save!
6) Then the new connection, enter your user name and password, open a connection, the user can only see the new database that was assigned to him
mysql -uusername -ppassword
username is a user name, password is the password, create a general user, then use the root user
2) After successful login into mysql database
use mysql
CREATE USER 'test02'@'localhost' IDENTIFIED BY 'test';
GRANT SELECT, INSERT, UPDATE, REFERENCES, DELETE, CREATE, DROP, ALTER, INDEX, CREATE VIEW, SHOW VIEW ON `test`.* TO 'test02'@'localhost';
flush privileges;
Reference link: http: //blog.csdn.net/u010514052/article/details/51104659