Thursday, December 05, 2013

How to change mysql root password from backend centos

MySQL is a relational database management system (RDBMS) being light weight it is most commonly used as a database application for websites, To change or set the mysql root password follow the steps below.
  • SSH Server
  • if Setting MySQL root password for the First time ,  use the Following Commands  at terminal.
  • [root@localhost~] #   mysqladmin -u root password “New – password”

Mysql should be running before you proceed to change the root password so check it.
  •  service mysql status
if running proceed to next step else start the mysql service first.
  • service mysql start
  •  Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password.
  • mysqld_safe --skip-grant-tables &
  •  Run the command mysql -u root
  • [root@server~] # mysql -u root
 you will get the MySQL monitor then enter the following commands . 
  • mysql > use mysql ;
  •   mysql >update user set password=PASSWORD(“ronak”) where User=’root’ ;
                   Here “ronak” is a new root password 
  •  mysql >  flush privileges ;
  •  mysql >  quit ;

No comments:

Post a Comment

Do Write about the Blog and Welcome to the world where open source is every thing :-)