Solved

How to reset MySQL 5.1 password on Window Operating system?

Posted on 2009-05-07
12
1,786 Views
Last Modified: 2013-04-23
Hi,
I am trying to reset MySQL 5.1 password using same method shown here http://downloads.mysql.com/docs/mysql-windows-excerpt-5.1-en.pdf\

but when i type
C:\>C:Program Files\MySQL\MySQL Server 5.1\bin\mysqld --init-file=C:\mysql-init.txt
on the command line, it gives me n error:

'C:Program' is not recognized as an internal or external command, operable program or batch file..

What am i doing wrong? Can i reset the password by reinstalling MySQL?
0
Comment
Question by:James_2424
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 2

Expert Comment

by:irf44z
ID: 24330884
Enclose the path&command within double quotes:

C:\>"C:Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --init-file=C:\mysql-init.txt

in DOS, if a folder contains spaces, you need to enclose the whole path in double quotes.

I hope you've verified that MYSQL is installed in C:Program Files\MySQL\MySQL Server 5.1  in your computer.
0
 
LVL 7

Expert Comment

by:spamster
ID: 24331674
and you probably need a slash "\" between C: and Program

"C:\program files\MySQL\MySQL Server 5.1\bin\mysqld"
0
 

Author Comment

by:James_2424
ID: 24331894
Hi,

thanks for helping..

I have tried both of the methods but was unsuccessful. I am attaching an image maybe this will help a bit.


mysqlErrorHelp.JPG
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:James_2424
ID: 24331979
tried this method too since I used a wizard to install mysql
mysqlErrorHelp2..JPG
0
 
LVL 2

Expert Comment

by:irf44z
ID: 24332197
Thanks, spamster, I somehow missed the \ out.

James, your first attempt is wrong, since it should be double quotes - " not single quote - '.

Your second syntax looks correct. Looks like the exe doesn't exist in the directory path.

Can you please navigate to the directory - C:\Program Files\MySQL\MySQL Server 5.1  via Windows Explorer and verify whether the file - mysld.exe is present there?
0
 

Author Comment

by:James_2424
ID: 24332362
thanks,

I tried it with double quote too but didn't execute.

It seems to me the file is there. Please see attachment. It is mysqld.exe right?
mysqlErrorHelp3..JPG
0
 
LVL 2

Expert Comment

by:irf44z
ID: 24335046
James, you missed the 'q' in mysqld >> You were trying to execute "mysld", which doesn't exist
 
It should be
"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld"

Open in new window

0
 

Author Comment

by:James_2424
ID: 24340725
Thanks irf44z,

Sorry it was a mistyped.
What i did was stopped mySQL from control panel then I tried typing everything exactly and now the command line window frozed.

Below is the image

Is there another way to set up mySQL? like uninstalling and reinstalling it? or does the password get stored in some catch even after i uninstall mySQL?
mysqlErrorHelp4..JPG
0
 
LVL 2

Accepted Solution

by:
irf44z earned 250 total points
ID: 24346689
Hi,

What you did is correct. The command window would look frozen but the password has actually got reset to what you specified in the init file (mysql-init.txt).

After you execute this command, go to Task Manager and terminate the process - mysqld.exe. Now, start the MySQL server the way you normally do (Windows Service OR from command prompt - as per your configuration).

If this still didn't reset your password, ensure that the mysqld.exe process is not running in Task Manager before you execute the command to reset the password. [Terminate the process if you find it running in Task Manager]


Yes, you can do a reinstall, but make sure that you delete the directory - C:\Documents and Settings\All Users\Application Data\MySQL right after you uninstall and before you reinstall MySQL again. [You would lose the tables and data. So make sure you have a copy of the create scripts/data]
0
 

Author Comment

by:James_2424
ID: 24426802
thanks it worked :D
0
 

Author Closing Comment

by:James_2424
ID: 31579211
thanks irf44z..
0
 

Expert Comment

by:mschneikert
ID: 39104661
Just come across this issue myself today. Very similar to James issue except I'm getting a weird error see attached. However it doesn't seem to reset my password.

This is the link I sent.

My mysql-init.txt file looks like this

UPDATE mysql.user SET Password='boguspassword' WHERE User='root';
FLUSH PRIVILEGES;

Any ideas?
MySQL-Error.JPG
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mysql ide 10 55
MySQL InnodDB Import from mysqldump takes forever. 2 73
MySQL Finding Duplicates in a Normalized Database 6 42
Code not executing correctly. 3 43
As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question