How to Reset the Root Password


first step stop mysql deamon , (in anotcher dis
#in arch linux

$ /etc/rc.d/mysqld stop
#in fedora
$ /etc/init.d/mysqld stop
#or
$ service mysqld stop
#in debian and ubunt
/etc/init.d/mysql stop
#or
$ sudo service mysql stop

run mysql in safe mode without grant tables as children “&”

$ mysqld_safe --skip-grant-tables &

Connect to mysql server as root

$ mysql -u root mysql

Change root password:

 mysql> UPDATE mysql.user SET Password=PASSWORD('INSERTHERENEWPASSWORD') WHERE User='root';
 mysql> FLUSH PRIVILEGES;
 mysql> exit
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s