Sunday, March 10, 2013

MySql set password for "root" user

How to set password for 'root' users on mysql


  1. Start mysqld with below option
  2. c:> mysqld --defaults-file=c:\mysqlc\my.ini --console --skip-grant-tables

  1. start mysql client
  2. use mysql
  3. update user set password=PASSWORD('newpassword') where user='root"
  4. FLUSH PRIVILEGES
restart mysqld without --skip-grant-tables option.. thats all