Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to reset password of root user in MySQL workbench

Tags:

mysql

I am accessing MySQL database using workbench 6.3 using root user.but we have forgot password of root user.so how can i reset password of root user

like image 831
pramod Avatar asked Sep 02 '17 02:09

pramod


People also ask

How do you reset your root password if you forgot the root password?

Enter the following: mount -o remount rw /sysroot and then hit ENTER. Now type chroot /sysroot and hit enter. This will change you into the sysroot (/) directory, and make that your path for executing commands. Now you can simply change the password for root using the passwd command.


1 Answers

From MySQL Dev Page - Generic Instructions, (try these in comand line or mysql prompt)

MySQL 5.7.6 and later:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';

MySQL 5.7.6 and earlier:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

Kindly refer the dev page for Platform Specific Options.

like image 86
pro_cheats Avatar answered Sep 28 '22 15:09

pro_cheats