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

Easy ruTorrent installer + Web server, FTP, Webmin (Ubuntu/Debian/Fedora/More)

All credit goes to Author brock from forums.rutorrent.org  original post here for reference also...

Optimize mySQL and Apache

Optimize mySQL: Memory usage is an important thing when consider the server. Normally mySQL...

Basic commands

How to use Linux:Linux is a Unix based operating system. Linux has a reputation as a very...

How to change the root password

How to change the root password Change root password: There are two kind of things we need to...

How to install mod_evasive

  How to install mod_evasive How to install mod_evasive on a Directadmin server by admin on...