How to change mysql root password

MySQL Change root Password:

Setting up mysql password is one of the essential tasks. By default root user is MySQL admin account. Here, We are going to discuss about                                                        ”  How to change mysql root password ? ”

Instructions:

1) unsing mysql admin

  • mysqladmin -u root -p ‘oldpassword’ password ‘newpass’
  • E.g :- mysqladmin -u root -p luck password ecvps

2) Changing mysql password for another user

  • If you want to change the password for particular user, you need to specify that user name.
  • E.g :- mysqladmin -u sam -p luck password ecvps  - here sam is the user

3) Using mysql command

  • mysql -u root -p – login to mysql server
  • mysql> use mysql;    -  use the mysql database
  • mysql > update user set password=PASSWORD(“new password”) where User = ‘ sam ‘ ;
  • mysql> flush privileges;
  • mysql>bye

Was this answer helpful?

 Print this Article

Also Read

Debian asking to insert cdrom to update?

open a terminalsunano /etc/apt/sources.listput a # in front of the line talking bout cd's (or...

How to install ImageMagick

Install ImageMagick: ImageMagick is a software suite to create, edit, and compose bitmap...

How to install IonCube Loaders

How to install ionCube loader: ionCube produces leading tools for PHP source code protection...

How to login SSH

Login using putty : 1)Download the putty from the following link...

KVM Install Guide

Table of Contents KVM Basic Install Individual Install Guides...