I have been trying to reset the root password of MySQL.
I have used to two methods to reset. But I didnt get it.
Following steps are done, But it doesn't work for me:
METHOD-1:
1) Stopped running of MySQL services and created a mysql-init.txt file. mysql-init.txt contains:
USE mysql;
UPDATE mysql.user SET Password=PASSWORD('vikash') WHERE User = 'root';
FLUSH PRIVILEGES;
2) I have opened the command prompt and i typed the following:
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqld.exe --defaults-file="my.ini" --init-file="C:\\Users\\user-name\\Desktop\\mysql-init.txt" --console
The ERROR which i got is as follows:
Could not open required defaults file: C:\Program Files\MySQL\MySQL Server 5.6\b in\my.ini
Fatal error in defaults handling. Program aborted
METHOD-2:
I simply opened the command prompt and typed as follows:
C:\Program Files\MySQL\MySQL Server 5.6\bin>mysqladmin -uroot -psample password
vikash
I got the error as:
Warning: Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
Please help me to reset the password...
mysqladmin -uroot -p
. mysql should then ask for your password (at this point, you would NOT use quotes) – Russell Uhl