How does the grant option work in MySQL?

How does the grant option work in MySQL?

This creates a MySQL user hugh (with no password!) and allows him to pass on his privileges for the music database to other users. Since the GRANT OPTION is given at the database level (to music.* ), hugh can pass on his privileges on that database, or on any of the tables or columns in that database.

How to grant MySQL privileges to another user?

Now, let’s give our privileges to another user: mysql> GRANT ALL ON music.* TO ‘selina’@’localhost’; Query OK, 0 rows affected (0.00 sec) This passes on all privileges to a new user, selina (with no password).

How to use grant statement to grant privileges to a user?

Permissible privileges for GRANT statement Privilege Meaning REPLICATION SLAVE Allow the user to use replicate slaves t SELECT Allow user to use SELECT statement SHOW DATABASES Allow user to show all databases SHUTDOWN Allow user to use mysqladmin shutdown co

How to grant permission to a specific user?

To provide a specific user with a permission, you can use this framework: GRANT type_of_permission ON database_name. table_name TO ‘ username ‘ @ ‘localhost’; If you want to give them access to any database or to any table, make sure to put an asterisk (*) in the place of the database name or table name.

How to grant a privilege in MySQL database?

The GRANT statement grants privileges to MySQL user accounts. To grant a privilege with GRANT, you must have the GRANT OPTION privilege, and you must have the privileges that you are granting. (Alternatively, if you have the UPDATE privilege for the grant tables in the mysql system database, you can grant any account any privilege.)

Is the use of Grant deprecated in MySQL 5.7?

Use of GRANT to define account SSL characteristics is deprecated in MySQL 5.7. Instead, establish or change SSL characteristics using CREATE USER or ALTER USER . Expect this GRANT capability to be removed in a future MySQL release.

What’s the difference between Grant and standard SQL?

The biggest differences between the MySQL and standard SQL versions of GRANT are: MySQL associates privileges with the combination of a host name and user name and not with only a user name. Standard SQL does not have global or database-level privileges, nor does it support all the privilege types that MySQL supports.