
- 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
MySQL appears to DROP USER but user still exists in MySQL.users table?
First check all the user and host from MySQL.user table with the help of select statement as shown below
mysql> select user,host from MySQL.user;
The following is the output
+------------------+-----------+ | user | host | +------------------+-----------+ | Bob | % | | Manish | % | | User2 | % | | mysql.infoschema | % | | mysql.session | % | | mysql.sys | % | | root | % | | @UserName@ | localhost | | Adam Smith | localhost | | James | localhost | | John | localhost | | John Doe | localhost | | User1 | localhost | | am | localhost | | hbstudent | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | +------------------+-----------+ 17 rows in set (0.00 sec)
Now, drop the user ‘hbstudent’ from MySQL.user table. The query is as follows −
mysql> drop user 'hbstudent'@'localhost'; Query OK, 0 rows affected (0.17 sec)
Now check the MySQL.user table to verify the user still exist in MySQL.user table or not. The query is as follows −
mysql> select user,host from MySQL.user;
The following is the output
+------------------+-----------+ | user | host | +------------------+-----------+ | Bob | % | | Manish | % | | User2 | % | | mysql.infoschema | % | | mysql.session | % | | mysql.sys | % | | root | % | | @UserName@ | localhost | | Adam Smith | localhost | | James | localhost | | John | localhost | | John Doe | localhost | | User1 | localhost | | am | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | +------------------+-----------+ 16 rows in set (0.00 sec)
- Related Questions & Answers
- Check if a user exists in MySQL and drop it?
- Solve ERROR 1396 (HY000): Operation DROP USER failed for 'user'@'localhost' in MySql?
- Drop trigger if exists in MySQL?
- How to update User Logged in Time for a specific user in MySQL?
- Can we use the word user for a MySQL table?
- Set user-defined variable with table name in MySQL prepare statement?
- Show a MySQL user-defined variables values in the result table?
- Using User-Defined Variables in MySQL
- MySQL CREATE USER with a variable?
- How to Drop MySQL Table using Java?
- Can we convert MD5 to SHA256 in a MySQL table with user password column?
- How can we change MySQL user password by using the ALTER USER statement?
- Display all grants for user in MySQL
- How to create MySQL user with limited privileges?
- MySQL query to create user and grant permission
Advertisements