Pages

Wednesday, September 4, 2013

How to Reset MySQL root Password

To provide multi user  access to number of databases a relation database management system is been developed that runs on a server and called as MySQL. MySQL is developed under GNU General Public License and its source code is available under its defined terms. MySQL is a popular choice of database for use in web applications and it performs really well with cPanel hosting accounts to store data of any websites. And suppose if you have forget the MySQL root password and you are not able to access your mysql service then you need to reset the password of MySQL root user by using following steps which are as follows,

Steps to Reset MySQL root Password :

1)root@server [~]/etc/init.d/mysqld stop

2)Start to MySQL server without password:
root@server [~]mysqld_safe –skip-grant-tables &

3) root@server [~] mysql
After that you can get the mysql prompt then run the following command

4)mysql >use mysql;

5)mysql >update user set password=PASSWORD(“NEWPASSWORD”) where User=’root’;

6)mysql > quit

7)root@server [~]/etc/init.d/mysqld stoproot@server [~]/etc/init.d/mysqld start
Now you can access your mysql service by using
[root@server ~]#mysql -u root -p

No comments:

Post a Comment