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
    I tried the following steps: Log in as super user or use sudo Open /etc/mysql/my.cnf using gedit Check the all the configuration Find bind-address, and change its value to the database server host machine's IP address. For me, it was localhost or 127.0.0.1 Save and close the file. Come back…
    Tags: mysql, start, service, execute, connect, user, daemon, mysqld

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: