How to reset mysql root password

it is quiet easy to reset mysql root password, here are the steps

  1. SSH as root to your machine
  2. Turn off the mysqld daemon if running RedHat/Fedora users can do so by executing:  service mysqld stop
  3. Run safe_mysqld by executing:

       safe_mysqld –skip-grant-tables

(this will run allow you to connect without a password)

4. Open a second shell / SSH again and execute:

mysql mysql

(to directly connect and select the mysql database which contains the user authentication data)
On the mysql prompt, execute:

update user set password=password(‘newpassword’) where user=’root’;

where newpassword is your newly chosen password.

4. That’s it! close everything and start your mysql daemon again:

service mysqld start

Related Posts

  • 53
    Steps to reset the mysql root password 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: Connect to mysql server using mysql client: # mysql -u root Welcome to the MySQL monitor.  Commands end with…
    Tags: mysql, root, password, reset, connect, service, start
  • 46
    Error: 1045 SQLSTATE: 28000 (ER_ACCESS_DENIED_ERROR) Message: Access denied for user '%s'@'%s' (using password: %s) This occurs when the user has no access to database server and user is trying to connect the database server. Suggestions:  Check the mysql user rights Check the database access rights Check the users IP
    Tags: user, mysql, password, connect, root
  • 43
    MySQL stores accounts in the user table of the mysql system database. An account is defined in terms of a user name and the client host or hosts from which the user can connect to the server. The account may also have a password. There are several distinctions between the…
    Tags: mysql, user, password, connect
  • 42
    > login on server through putty with current username & password > type: passwd root it will ask to put the new password...thats it
    Tags: password, root, reset
  • 41
    mysqld, also known as MySQL Server, is the main program that does most of the work in a MySQL installation. mysqld, is MySQL server daemon program which runs quietly in background on MySQL Database Server. MySQL Server manages access to the MySQL data directory that contains databases and tables. The…
    Tags: mysql, mysqld, set, daemon

Satya Prakash

VOIP Expert: More than 8 years of experience in Asterisk Development and Call Center operation Management. Unique Combination of Skill Set as IT, Analytics and operation management.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: