How to reset/change MySql root password command line in ubuntu linux - webtechpoints

Latest

Saturday, November 11, 2017

How to reset/change MySql root password command line in ubuntu linux

Here I’ll show you How to reset/change MySql root password command line in ubuntu linux, Using some mysql CLI commands you can easily recover your mysql administrative password. As I forgot to my mysql root password then i use below commands to reset my mysql root password and it works like charm.
Step-1: First login to your ubuntu server using ssh and stop mysql server.
$ sudo /etc/init.d/mysql stop
OR
$ sudo service mysql stop
Step-2: Start the MySQL (mysqld) server/daemon process with the –skip-grant-tables option so that it will not prompt for password.
$ sudo mysqld_safe --skip-grant-tables &
Step-3: Connect with mysql server as root user by running below command on terminal.
$ sudo mysql -u root
Step-4: Set new mysql root user password.Just replace “NewPassword” with your desired password in below command.
$ UPDATE user SET Password=PASSWORD('NewPassword') WHERE User='root'; FLUSH PRIVILEGES; exit;
Step-5: All done now restart mysql server.
$ sudo /etc/init.d/mysql start
OR
$ sudo service mysql start

2 comments:

  1. You fully match our expectation and the selection of our data. free password manager

    ReplyDelete
  2. Any one of these passwords can be recovered and most passwords are retrieved using the dictionary attack feature, the method consists of trying "every word in the dictionary" as a possible password for an encrypted message.reset windows 10 password

    ReplyDelete