

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to show GRANTS for root in MySQL?
For this, use the following syntax, wherein we have used SHOW GRANTS −
SHOW GRANTS FOR 'yourUserName'@'yourHostName';
HostName may be ‘%’ or localhost.
Let us implement the above syntax in order to show grants from ROOT −
mysql> SHOW GRANTS FOR 'root'@'%' ;
Output
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for root@% | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON *.* TO `root`@`%` WITH GRANT OPTION | | GRANT BACKUP_ADMIN,BINLOG_ADMIN,CONNECTION_ADMIN,ENCRYPTION_KEY_ADMIN,GROUP_REPLICATION_ADMIN,PERSIST_RO_VARIABLES_ADMIN,REPLICATION_SLAVE_ADMIN,RESOURCE_GROUP_ADMIN,RESOURCE_GROUP_USER,ROLE_ADMIN,SET_USER_ID,SYSTEM_VARIABLES_ADMIN,XA_RECOVER_ADMIN ON *.* TO `root`@`%` | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 2 rows in set (0.17 sec)
- Related Questions & Answers
- Display all grants for user in MySQL
- Check privileges (grants) for a specific user in MySQL?
- Display all grants of a specific user in MySQL
- How to customize `show processlist` in MySQL?
- Difference between SHOW INDEX, SHOW INDEXES and SHOW KEYS in MySQL?
- How can I change root username in MySQL?
- How to reset or change the MySQL root password?
- Rename Root @ localhost username in MySQL?
- How to show for loop using a flowchart in JavaScript?
- How to calculate root mean square error for linear model in R?
- How can I display all databases in MySQL and for each database show all tables?
- View the auto_increment value for a table in MySQL without using SHOW TABLE?
- Only show tables with certain patterns in MySQL “show tables”?
- How to show a nested for loop in a flow chart in JavaScript?
- Open MySQL root access from all hosts?
Advertisements