Fastest Web Hosting

how do i retrieve my mysql username and password?

0 votes
asked Nov 11, 2016 in Mysql by rajatinsa (3,350 points)

I forget my mysql username and i could not connect with that....please help me

1 Answer

0 votes
answered Nov 11, 2016 by rajatinsa (3,350 points)

Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services manager:

Start Menu -> Control Panel -> Administrative Tools -> Services

Then find the MySQL service in the list, and stop it. If your server is not running as a service, you may need to use the Task Manager to force it to stop.

Create a text file and place the following statements in it. Replace the password with the password that you want to use.

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

The UPDATE and FLUSH statements each must be written on a single line.

Save the file named C:\mysql-init.txt

Run Command Line by

Start Menu -> Run -> cmd

Start the MySQL server with the special --init-file option:

C:\> C:\mysql\bin\mysqld-nt --init-file = C:\mysql-init.txt
Start Menu -> Control Panel -> Administrative Tools -> Services

Find the MySQL service in the list, right-click on it, and choose the Properties option. The Path to executable field contains the --defaults-file setting.
After the server has started successfully, delete C:\mysql-init.txt.
Stop the MySQL server, then restart it in normal mode again. I hope it will help

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's