Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2015 August How to reset MySQL root Password in Ubuntu

How to reset MySQL root Password in Ubuntu

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

Hello Friends,

Recently, I got a request for resetting the MySQL root password.

One of my colleges tried many solutions from different blog and website, but he failed and the question came to me.

As I am always ready for new research and problem solving, so I started my work to reset the MySQL root password.

On the internet, you can find many similar solutions and I have also tired from these solutions, but I was failed to reset root/admin password.

After some exercise, I got success on this.

Below are the final steps:

Step 1:
Stop MySQL Service.

1
sudo stop mysql

Step 2:
Kill all running mysqld.

1
sudo killall -9 mysqld

Step 3:
Starting mysqld in Safe mode.

1
sudo mysqld_safe --skip-grant-tables --skip-networking &

Step 4:
Start mysql client

1
mysql -u root

Step 5:
After successful login, please execute this command to change any password.
Here you can visit more about MySQL Flush Command:

1
FLUSH PRIVILEGES;

Step 6:
You can update mysql root password .

1
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';

Step 7:
Please execute this command.

1
FLUSH PRIVILEGES;
Aug 11, 2015Anvesh Patel
MySQL Query Cache Part II/IIHow to store and retrieve XML data into MySQL
Comments: 5
  1. furtdsolinopv
    December 25, 2015 at 9:57 pm

    Your place is valueble for me. Thanks!…

    • Nidhin jacob cleetu
      January 12, 2016 at 9:42 am

      it doesn’t works for me . Access denied msg comes

      • Anvesh Patel
        Anvesh Patel
        January 18, 2016 at 7:08 pm

        Please share more details so I can help you.
        You can also mail me on anvesh@dbrnd.com

  2. Yoyo
    April 17, 2016 at 5:08 am

    Oh my goodness! an amazing article dude. Thank you However You helped me lot Anvesh !

  3. Farlin
    April 18, 2016 at 8:25 pm

    WONDERFUL Post.thanks for share..more wait .. …

Anvesh Patel
Anvesh Patel

Database Engineer

August 11, 2015 MySQLAnvesh Patel, database, database research and development, MySQL, MySQL Command, MySQL Database Administrator, MySQL Database Designing, MySQL Database Programming, MySQL Error, MySQL Performance Tunning, MySQL Query, MySQL Tips and Tricks, mysqld_safe, Password, root, Ubuntu
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....