Thursday, October 2, 2014

Resetting mysql root password in Unix or Linux systems!

These are the quick steps you can proceed to reset the mysql password in Linux or Unix.
  1. Stop the mysql server
  2. Create a file in /tmp with filename:mysql-init with the content as below:
  3. UPDATE mysql.user SET Password=PASSWORD('80odP@s5') WHERE User='root';
    FLUSH PRIVILEGES;
  4. Execute the below command to start the MySQL with the new paasword
    mysqld_safe --init-file=/tmp/mysql-init &
  5. After the server has started successfully, delete /tmp/mysql-init. 
  6. Now try to log-in to MySQL with the new password.

 Happy coding!

No comments:

Post a Comment