Category: MySQL

Lost MySQL Root User, Create Root User skip-grant-tables:

1. Log in via SSH
2. Open /etc/my.cnf
3. add the following under the mysqld group


4. Restart MySQL and now you can login as any user with full permissions
5. Go to mysql database and add a root user with permissions manually, set all priv fields to Y

For MySQL 4

INSERT INTO user VALUES('localhost','root',PASSWORD('PASSWORD'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);

1. Remove the skip-grant-tables
2. Restart MySQL and now you can login with your root user


0 0 vote
Article Rating



How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.