Resetting My SQL password

For resetting mysql root passwd follow the following steps:

Step 1: Stop mysql service

/etc/init.d/mysql stop

Step 2: Start to mysql server w/o password

mysqld_safe –skip-grant-tables &

Step 3: Now connect to mysql server using mysql client

mysql -u root

Step 4: Setup new mysql root user password

mysql> use mysql;
     mysql> update user set password=PASSWORD(“sctfmysql”) where User=’root’;
     mysql> flush privileges;
     mysql> quit

Step 4: Stop mysql Server

/etc/init.d/mysql stop

Step 5:Start mysql server and test it

/etc/init.d/mysql start

mysql -u root -p

Step 6:It’s done 😀

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

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