0

I'm having MySQL on RHEL, and phpMyAdmin interface also. I have normal MySQL user access which i remember but i forget the root password.

  • How to SAFELY reset the MySQL root password? (I have root account on O/S)
夏期劇場
  • 17,821
  • 44
  • 135
  • 217
  • This is answered on serverfault.com : "Lost MySQL password" - http://serverfault.com/questions/287225/lost-mysql-password/287235#287235 – sleske Feb 05 '13 at 08:44
  • There're also several dupes heres, I've chosen [a random one](http://stackoverflow.com/questions/4258124/how-to-reset-mysql-root-password) – Álvaro González Feb 05 '13 at 08:47

2 Answers2

7

From Here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Stop mysqld and restart it with the --skip-grant-tables option. This enables anyone to connect without a password and with all privileges. Because this is insecure, you might want to use --skip-grant-tables in conjunction with --skip-networking to prevent remote clients from connecting.

Connect to the mysqld server with this command:

shell> mysql

Issue the following statements in the mysql client. Replace the password with the password that you want to use.

mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
    ->                   WHERE User='root';
mysql> FLUSH PRIVILEGES;

The FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change

FreudianSlip
  • 2,870
  • 25
  • 24
0

WINDOWS USERS

For me in wondows 8 this worked; First go to where you installed mysql, I was using wamserver and installed it under D:\Programs\wamp\bin\mysql\mysql5.6.12\bin so cd to that directory, then;

-> mysql UPDATE mysql.user SET Password=PASSWORD('xvpaic7q') -> WHERE User='root'

-> FLUSH PRIVILEGES
numediaweb
  • 16,362
  • 12
  • 74
  • 110