Friday, September 03, 2021

delete a user in mysql

I had created a user in mysql but was unable to run scripts as that user. Reason was that special characters were present in the password, which we should avoid. So, deleted and re-created. 

mysql -u root -h servername.tld -p mysql
SELECT User,Host FROM mysql.user;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'whicheveruser'@'localhost';
DROP USER 'whicheveruser'@'localhost';

No comments:

Post a Comment