navicat control a mysql database belongs to a user

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

2. command lines 
1) into the mysql bin directory
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
3) Create a new user
CREATE USER 'test02'@'localhost' IDENTIFIED BY 'test';
'Test02' to create a new user name, 'test' as the user password
4) to give permission for new users
GRANT SELECT, INSERT, UPDATE, REFERENCES, DELETE, CREATE, DROP, ALTER, INDEX, CREATE VIEW, SHOW VIEW ON `test`.* TO 'test02'@'localhost';
Back ON 'test' for the database name, TO behind 'test02' means that the user, 'localhost' means that only local access, if you want all IP can access, you can replace localhost '*' asterisk
5) Refresh rights
flush privileges;


Reference link: http: //blog.csdn.net/u010514052/article/details/51104659

Guess you like

Origin www.cnblogs.com/lvcha/p/11982182.html