Monday, 1 October 2012

How to change or set the MySQL root password




PASSWORD SET/CHANGE WITH MYSQLADMIN

Every database has its own default passwords such as ‘root’ and ‘sa’. This can be horrible when you find your database hacked due to them. In MySQL your default password is root, now the time to change it. Go to mysqladmin, and run the following commands.

Syntax:
mysqladmin -u root password “newpassword”
mysqladmin -u root -h host_name password “newpassword”

Example:
mysqladmin -u root password ws8dr8as3
mysqladmin -u root -h localhost password ws8dr8as3

Note:  This way puts your password in the shell history.


SECURE PASSWORD SET/CHANGE WITH MYSQL CONSOLE


Go to MySQL console then type the given command with the desired password:

mysql> SET PASSWORD FOR root@localhost=PASSWORD(‘newpasswordgoeshere’);


No comments:

Post a Comment

Thanks for visiting...

How to access the files when Windows is damage

  You Need An optical drive (CD,DVD or Blu-Ray) drive on the computer you wish to repair. An  burning capable  optical drive on your working...