mistakenly I deleted the mysql root user

accidentally deleted mysql root user

Some time back I accidentally deleted mysql root user. Then when checked mysql then mysql is not accessible to me from root user. I have the trick to restore mysql database.

accidentally deleted mysql root user

I am using the fedora 14 on my machine. After trying so many things at the end I found the solution.

use the following steps:

First I stoped mysql using following command.

#/etc/init.d/mysqld stop

Then I created one file with following conent

#file mysql_reset

UPDATE mysql.user SET Password=PASSWORD(‘newpassword’) WHERE User=’root’;

#mysqld_safe –init-file=/home/techiego/mysql-init &

Than again I stooped mysql process and restarted mysql. I was able to access my mysql again.

accidentally deleted mysql root user
accidentally deleted mysql root user

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.