MySQL user management, rights management

Source: Internet
Author: User

MySQL permissions-related actions: The permissions granted are divided into four groups: column permissions: Related to a specific column in the table, for example, updating the Value table permission for the Name column in the test table with the UPDATE statement: related to all data for a specific table, for example: using Select Query test has all data database permissions in: Related to all tables in a specific database, for example: permissions to create a new table in an existing test database user rights: related to all databases known to MySQL, For example: Delete an existing database or create a new database to add user ' Create user ' username ' @ ' host name ' identified by ' password ' as:create user ' lin3615 ' @ ' localhost ' identified by ' 123456 ' The user created at this time is not authorized to operate other databases and tables, only the table name can be viewed create user ' lin3615 ' @ ' www.lin3615.net ' means that the created users log on from the www.lin3615.net host to MySQL, Without a password, it means that you can connect to create user ' lin3615 ' @ '% ' with create user ' lin3615 ', by default it is possible to log on from each host and delete the user's user name ' @ ' hostname ' As:drop User ' lin3615 ' @ ' localhost ' modifies username, but the password is unchanged, cannot be modified with account name rename user ' new username ' @ ' host name ' to ' old username ' @ ' hostname ' as:rename user ' ok123 ' @ ' localhost ' to ' lin3615 ' @ ' localhost ' modifies user password: Set password for ' username ' @ ' hostname ' = password (' new password ') as:set password for ' lin3615 ' @ ' localhost ' =password (' 123456 ') grants table and column permissions: Select,insert,delete,update:select,insert,delete,update table permissions References: Give the user the right to create a foreign key to reference a particular table Create,alter,index,drop: Specify the user to create the specified table, modify the table, define the index, delete the permissions of the table All/all privileges: All permissions form: Grant permissions on library/ Table to user name [with option] if grantedA nonexistent user will automatically create a user as: Grant lin3615 query Table permissions: Grant Select on test to lin3615as: Grant Selecton Test.testto ' lin3615 ' @ ' for new users localhost ' identified by ' 123456 ' Grant database permissions select,insert,update,deletereferences: Give the user permission to create a table foreign key to a specific database creation: Give permissions to create tables in a particular database alert: Give permissions to modify tables in a specific database drop: give permission to delete tables and views in database index: give the index of the table in a particular database and modify permissions create temporary tables: Granting permissions to create temporary tables on a specific database create view: Giving permissions to a particular database to creating views Show view: Giving permissions to view views in a particular database create routine: give permission to create stored procedures and stored functions in a particular database execute Routine: Giving permission to use stored procedures and functions in a particular database alter routine: Give permissions to modify stored procedures and functions in a specific database lock tables: Grant the lock permissions for tables in a particular database All/all privileges: All rights as: Grant lin3615 to query the test database for all tables in Grant Selectto Test.*on lin3615as: Grant lin3615 to create data tables in database test, update data tables, delete data table permissions Grant Create,alter,dropon test.*to lin3615 Grant user Rights create User: Give users permission to set up and delete databases Show database: Give users permission to view databases using show database as: Grant lin3615 Create,alter,drop permissions to all tables in all databases Grant Create,alter,dropon *.*to lin3615 Grant lin3615 Create new user permissions grant Create Useron * . *to lin3615 permission to pass: With GRANT option to pass its own permissions to the user as:grant Selecton test.*to lin3615with Grant option above the statement, in fact, the Lin3615 the permissions of all the action tables are granted to his users, instead of only granting the function of the query to reclaim permissions revoke permissions [option]on database. Table name from user as: Reclaim lin3615 update permissions in Test.test revoke Updateon Test.testfrom lin3615 One of the option options means that deleting the appropriate permissions that are passed to other users by this user right if there are no option options means that those users also have those permissions

MySQL user management, rights management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.