Thursday, November 21, 2013

Create a New User with same privileges as root in MYSQL



Sometimes we may need to create a new user with same  privileges as root in MYSQL in case we forget the root password.
To  create a new user jianse  in MySQL with password "mypass"
CREATE USER 'jiansen'@'localhost' IDENTIFIED BY 'mypass';
Sets all simple privileges except GRANT OPTION to new user jiansen
GRANT ALL PRIVILEGES ON * . * TO 'jiansen'@'localhost';
Add GRANT OPTION to new user jiansen
GRANT GRANT OPTION ON * . * TO 'jiansen'@'localhost';
Now user jiansen has same rigth as root in MySQL.

Reference:
Crack mysql root password in several ways
 http://www.sureshkumarpakalapati.in/2011/07/crack-mysql-root-password-in-several.html

No comments:

Post a Comment